@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

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

:root {
  --bg:    #060607;
  --bg1:   #0a0a0c;
  --bg2:   #0f0f12;
  --bg3:   #141418;
  --bg4:   #1a1a1f;
  --bg5:   #212128;
  --line:  #16161a;
  --line2: #1e1e24;
  --line3: #2a2a34;
  --t0:    #f0f0f4;
  --t1:    #8a8a9a;
  --t2:    #44444e;
  --t3:    #222228;
  --ac:    #f0f0f4;
  --ac2:   #b0b0be;
  --ac3:   #505060;
  --red:   #e05555;
  --red2:  #ff7070;
  --grn:   #34a86a;
  --grn2:  #48cc84;
  --amber: #d48830;
  --mono:  'JetBrains Mono', monospace;
  --sans:  'Inter', sans-serif;
  --r:     5px;
  --r2:    8px;
  --r3:    12px;
  --r4:    16px;
  --shadow:  0 4px 24px rgba(0,0,0,.7);
  --shadow2: 0 20px 80px rgba(0,0,0,.9);
}

html { background: var(--bg); }
body { font-family: var(--sans); background: var(--bg); color: var(--t1); min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--ac3); }

/* ══ LOGIN ══════════════════════════════════════════════════════════════ */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); position: relative; overflow: hidden; }
.login-grid { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.login-grid canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-card { width: 100%; max-width: 400px; position: relative; z-index: 1; padding: 0 48px; }
.login-card > * { opacity: 0; transform: translateY(10px); animation: fadeUp .55s cubic-bezier(.16,1,.3,1) forwards; }
.login-card > *:nth-child(1) { animation-delay: .04s; }
.login-card > *:nth-child(2) { animation-delay: .09s; }
.login-card > *:nth-child(3) { animation-delay: .14s; }
.login-card > *:nth-child(4) { animation-delay: .19s; }
.login-card > *:nth-child(5) { animation-delay: .24s; }
.login-card > *:nth-child(6) { animation-delay: .29s; }
.login-card > *:nth-child(7) { animation-delay: .34s; }
.login-card > *:nth-child(8) { animation-delay: .39s; }
.login-card > *:nth-child(9) { animation-delay: .44s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.login-eyebrow { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--t3); text-transform: uppercase; margin-bottom: 40px; display: flex; align-items: center; gap: 10px; }
.login-eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--line3); flex-shrink: 0; }
.login-h { font-size: 48px; font-weight: 300; color: var(--t0); line-height: .94; letter-spacing: -.04em; margin-bottom: 10px; }
.login-h b { display: block; font-weight: 700; }
.login-sub { font-family: var(--mono); font-size: 9px; color: var(--t3); margin-bottom: 40px; letter-spacing: .05em; }
.field { margin-bottom: 8px; }
.field-label { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; color: var(--t2); text-transform: uppercase; display: block; margin-bottom: 6px; }
.field-input { width: 100%; padding: 11px 13px; background: var(--bg2); border: 1px solid var(--line2); color: var(--t0); font-size: 13px; font-family: var(--sans); font-weight: 400; outline: none; border-radius: var(--r2); transition: border-color .15s, background .15s; }
.field-input::placeholder { color: var(--t3); }
.field-input:focus { border-color: var(--line3); background: var(--bg3); }
.captcha { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r2); margin-bottom: 8px; cursor: pointer; user-select: none; transition: border-color .15s; }
.captcha:hover { border-color: var(--line3); }
.captcha.done { border-color: rgba(72,204,132,.2); }
.captcha-left { display: flex; align-items: center; gap: 11px; }
.captcha-box { width: 17px; height: 17px; border: 1px solid var(--line3); border-radius: 3px; display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.captcha.loading .captcha-box { border-color: var(--t2); }
.captcha.done .captcha-box { border-color: var(--grn2); background: var(--grn2); }
.captcha-spinner { width: 9px; height: 9px; border: 1.5px solid transparent; border-top-color: var(--t1); border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.captcha.loading .captcha-spinner { display: block; }
.captcha-checkmark { display: none; }
.captcha.done .captcha-checkmark { display: flex; }
.captcha-checkmark svg { width: 9px; height: 9px; stroke: var(--bg); fill: none; stroke-width: 2.5; }
.captcha-label { font-size: 12px; color: var(--t1); font-weight: 400; }
.captcha.done .captcha-label { color: var(--grn2); }
.captcha-brand { font-family: var(--mono); font-size: 7px; color: var(--t3); text-align: right; line-height: 1.8; }
.login-err { font-family: var(--mono); font-size: 9px; color: var(--red2); padding: 9px 12px; background: rgba(224,85,85,.04); border: 1px solid rgba(224,85,85,.12); border-radius: var(--r2); margin-bottom: 8px; display: none; align-items: center; gap: 8px; }
.login-btn { width: 100%; padding: 12px; background: var(--t0); border: none; color: var(--bg); font-size: 13px; font-weight: 600; font-family: var(--sans); cursor: pointer; border-radius: var(--r2); margin-top: 4px; transition: background .15s, transform .1s, opacity .15s; }
.login-btn:hover:not(:disabled) { background: var(--ac2); transform: translateY(-1px); }
.login-btn:active:not(:disabled) { transform: translateY(0); }
.login-btn:disabled { opacity: .12; cursor: not-allowed; }
.login-footer { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.login-about { font-family: var(--mono); font-size: 9px; color: var(--t2); cursor: pointer; letter-spacing: .05em; background: none; border: none; padding: 0; transition: color .12s; }
.login-about:hover { color: var(--t0); }

/* ══ APP SHELL ══════════════════════════════════════════════════════════ */
.app { display: none; height: 100vh; flex-direction: column; overflow: hidden; }
.app.visible { display: flex; }

.topbar { height: 48px; background: var(--bg1); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 14px; gap: 6px; flex-shrink: 0; z-index: 50; }

.logo { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: -.02em; color: var(--t0); margin-right: auto; display: flex; align-items: center; gap: 9px; }
.logo-mark { width: 26px; height: 26px; background: var(--t0); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-mark span { font-size: 8px; font-family: var(--mono); font-weight: 700; color: var(--bg); line-height: 1; }
.logo b { color: var(--t0); font-weight: 700; }

.node-pill { display: flex; align-items: center; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r2); overflow: hidden; height: 30px; transition: border-color .12s; }
.node-pill:hover { border-color: var(--line3); }
.node-dot { width: 5px; height: 5px; border-radius: 50%; margin-left: 10px; flex-shrink: 0; transition: all .4s; }
.node-dot.online  { background: var(--grn2); box-shadow: 0 0 6px rgba(72,204,132,.45); }
.node-dot.offline { background: var(--t3); }
.node-pill select { padding: 0 7px; background: transparent; border: none; color: var(--t1); font-size: 11px; font-family: var(--mono); outline: none; cursor: pointer; min-width: 120px; height: 100%; }
.node-pill select option { background: var(--bg2); }
.node-sw { padding: 0 10px; height: 100%; background: transparent; border: none; border-left: 1px solid var(--line2); color: var(--t2); font-size: 10px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: all .12s; white-space: nowrap; }
.node-sw:hover { color: var(--t0); background: var(--bg3); }

.tbtn { height: 30px; padding: 0 11px; background: transparent; border: 1px solid var(--line2); color: var(--t2); font-size: 11px; font-family: var(--sans); font-weight: 500; cursor: pointer; border-radius: var(--r2); transition: all .12s; }
.tbtn:hover { border-color: var(--line3); color: var(--t0); background: var(--bg2); }
.tbtn.hi { color: var(--t0); border-color: var(--line3); background: var(--bg2); }
.tbtn.hi:hover { background: var(--bg3); }

.uchip { display: flex; align-items: center; gap: 7px; padding: 2px 10px 2px 3px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 99px; transition: border-color .12s; cursor: default; }
.uchip:hover { border-color: var(--line3); }
.uav { width: 22px; height: 22px; background: var(--bg5); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: var(--t0); font-family: var(--mono); flex-shrink: 0; }
.uname { font-size: 11px; color: var(--t1); font-weight: 500; }

/* ══ BODY ═══════════════════════════════════════════════════════════════ */
.body { display: flex; flex: 1; overflow: hidden; }

/* ══ SIDEBAR ════════════════════════════════════════════════════════════ */
.sidebar { width: 204px; background: var(--bg1); border-right: 1px solid var(--line); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; padding: 10px 6px; }
.sb-lbl { font-family: var(--mono); font-size: 8px; letter-spacing: .12em; color: var(--t3); text-transform: uppercase; padding: 12px 8px 5px; display: block; }
.sb-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r); cursor: pointer; color: var(--t2); font-size: 12px; font-weight: 500; transition: all .1s; user-select: none; position: relative; }
.sb-item:hover { background: var(--bg2); color: var(--t1); }
.sb-item.active { background: var(--bg3); color: var(--t0); }
.sb-item svg { width: 13px; height: 13px; flex-shrink: 0; opacity: .25; transition: opacity .1s; }
.sb-item.active svg { opacity: .8; }
.sb-item:hover svg { opacity: .45; }
.sb-divider { height: 1px; background: var(--line); margin: 5px 0; }

/* ══ MAIN ═══════════════════════════════════════════════════════════════ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.action-bar { padding: 6px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 2px; flex-shrink: 0; background: var(--bg1); }
.abar-btn { height: 26px; display: inline-flex; align-items: center; gap: 4px; padding: 0 9px; background: transparent; border: 1px solid transparent; color: var(--t2); font-size: 11px; font-family: var(--sans); font-weight: 500; cursor: pointer; border-radius: var(--r); transition: all .1s; white-space: nowrap; }
.abar-btn:hover { background: var(--bg2); border-color: var(--line2); color: var(--t0); }
.abar-btn.primary { background: var(--t0); border-color: var(--t0); color: var(--bg); font-weight: 600; }
.abar-btn.primary:hover { background: var(--ac2); border-color: var(--ac2); }
.abar-btn.danger { color: var(--red2); }
.abar-btn.danger:hover { border-color: rgba(224,85,85,.15); background: rgba(224,85,85,.05); }
.abar-sep { width: 1px; height: 12px; background: var(--line2); margin: 0 2px; flex-shrink: 0; }
.abar-spacer { flex: 1; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 8px; color: var(--t3); pointer-events: none; }
.search-input { height: 26px; padding: 0 8px 0 26px; background: var(--bg2); border: 1px solid var(--line2); color: var(--t0); font-size: 11px; font-family: var(--sans); outline: none; border-radius: var(--r); width: 140px; transition: all .15s; }
.search-input::placeholder { color: var(--t3); }
.search-input:focus { border-color: var(--line3); width: 200px; }
.view-toggle { display: flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); overflow: hidden; }
.vt-btn { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; cursor: pointer; color: var(--t2); transition: all .1s; }
.vt-btn:hover { color: var(--t1); }
.vt-btn.active { background: var(--bg4); color: var(--t0); }
.breadcrumb { display: flex; align-items: center; gap: 5px; padding: 0 14px; height: 28px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 9px; color: var(--t3); flex-shrink: 0; background: var(--bg1); }
.bc-back { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line2); border-radius: var(--r); cursor: pointer; color: var(--t2); transition: all .1s; flex-shrink: 0; }
.bc-back:hover { border-color: var(--line3); color: var(--t0); background: var(--bg3); }

/* ══ FILES ══════════════════════════════════════════════════════════════ */
.file-area { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; }
.file-list { display: flex; flex-direction: column; gap: 1px; }
.fc { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r3); padding: 16px 10px 44px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, transform .12s; text-align: center; position: relative; user-select: none; overflow: hidden; }
.fc:hover { border-color: var(--line3); background: var(--bg2); box-shadow: 0 4px 20px rgba(0,0,0,.5); transform: translateY(-1px); }
.fc.selected { border-color: var(--line3); background: var(--bg2); }
.fc-check { position: absolute; top: 8px; left: 8px; width: 14px; height: 14px; border: 1px solid var(--line3); border-radius: 3px; display: flex; align-items: center; justify-content: center; transition: all .12s; background: var(--bg3); }
.fc.selected .fc-check { border-color: var(--t0); background: var(--t0); }
.fc-check-mark { display: none; }
.fc.selected .fc-check-mark { display: block; }
.fc-check-mark svg { width: 7px; height: 7px; stroke: var(--bg); color: var(--bg); }
.fc-icon { width: 38px; height: 38px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; border-radius: var(--r2); background: var(--bg2); border: 1px solid var(--line2); transition: all .15s; }
.fc-icon svg { width: 15px; height: 15px; color: var(--t2); }
.fc.folder .fc-icon { background: var(--bg3); border-color: var(--line3); }
.fc.folder .fc-icon svg { color: var(--t0); }
.fc:hover .fc-icon { border-color: var(--line3); }
.fc-name { font-size: 11px; font-weight: 500; color: var(--t1); word-break: break-all; line-height: 1.4; margin-bottom: 2px; }
.fc-meta { font-family: var(--mono); font-size: 8px; color: var(--t3); }
.fc-actions { position: absolute; bottom: 0; left: 0; right: 0; background: var(--bg2); border-top: 1px solid var(--line2); border-radius: 0 0 var(--r3) var(--r3); padding: 5px; gap: 2px; display: none; justify-content: center; }
.fc.selected .fc-actions, .fc:hover .fc-actions { display: flex; }
.fa-btn { height: 22px; padding: 0 7px; background: transparent; border: none; color: var(--t2); font-size: 10px; font-family: var(--sans); cursor: pointer; border-radius: var(--r); transition: all .09s; white-space: nowrap; font-weight: 500; }
.fa-btn:hover { background: var(--bg4); color: var(--t0); }
.fa-btn.red { color: var(--red2); }
.fa-btn.red:hover { background: rgba(224,85,85,.1); }
.fl { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r); cursor: pointer; transition: background .08s; user-select: none; }
.fl:hover { background: var(--bg1); }
.fl.selected { background: var(--bg2); }
.fl-check { width: 13px; height: 13px; border: 1px solid var(--line2); border-radius: 3px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .09s; }
.fl.selected .fl-check { background: var(--t0); border-color: var(--t0); }
.fl-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); }
.fl-icon svg { width: 10px; height: 10px; color: var(--t2); }
.fl.folder .fl-icon { background: var(--bg3); border-color: var(--line3); }
.fl.folder .fl-icon svg { color: var(--t0); }
.fl-name { font-size: 12px; font-weight: 500; color: var(--t1); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-size { font-family: var(--mono); font-size: 9px; color: var(--t2); width: 60px; text-align: right; flex-shrink: 0; }
.fl-date { font-family: var(--mono); font-size: 9px; color: var(--t2); width: 84px; text-align: right; flex-shrink: 0; }
.fl-actions { display: none; align-items: center; gap: 2px; flex-shrink: 0; }
.fl:hover .fl-actions, .fl.selected .fl-actions { display: flex; }
.fla-btn { height: 22px; padding: 0 8px; background: var(--bg2); border: 1px solid var(--line2); color: var(--t2); font-size: 10px; font-family: var(--sans); cursor: pointer; border-radius: var(--r); transition: all .09s; white-space: nowrap; font-weight: 500; }
.fla-btn:hover { background: var(--bg3); color: var(--t0); border-color: var(--line3); }
.fla-btn.red { color: var(--red2); border-color: transparent; }
.fla-btn.red:hover { background: rgba(224,85,85,.07); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 320px; gap: 12px; grid-column: 1/-1; }
.empty-state svg { width: 30px; height: 30px; opacity: .06; }
.empty-state p { font-size: 13px; font-weight: 500; color: var(--t2); }
.empty-state small { font-family: var(--mono); font-size: 9px; color: var(--t3); }

/* ══ STATUS ═════════════════════════════════════════════════════════════ */
.status-page { display: none; flex: 1; overflow-y: auto; padding: 28px; background: var(--bg); }
.status-page.visible { display: block; }
.pg-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.pg-title { font-size: 20px; font-weight: 700; color: var(--t0); letter-spacing: -.02em; margin-bottom: 4px; }
.pg-sub { font-family: var(--mono); font-size: 9px; color: var(--t3); }
.pg-action { height: 28px; padding: 0 12px; background: transparent; border: 1px solid var(--line2); color: var(--t2); font-size: 11px; font-family: var(--sans); font-weight: 500; cursor: pointer; border-radius: var(--r2); transition: all .12s; }
.pg-action:hover { border-color: var(--line3); color: var(--t0); background: var(--bg1); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px; margin-bottom: 28px; }
.stat-card { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r3); padding: 20px 18px; transition: border-color .15s, transform .12s; position: relative; overflow: hidden; }
.stat-card:hover { border-color: var(--line2); transform: translateY(-1px); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line3); }
.stat-card.col-grn::before   { background: var(--grn2); opacity: .4; }
.stat-card.col-amber::before { background: var(--amber); opacity: .4; }
.stat-card.col-ac::before    { background: var(--t0); opacity: .1; }
.stat-tag { font-family: var(--mono); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: var(--t2); margin-bottom: 14px; display: block; }
.stat-val { font-size: 30px; font-weight: 300; color: var(--t0); line-height: 1; margin-bottom: 4px; letter-spacing: -.02em; }
.stat-sub { font-family: var(--mono); font-size: 9px; color: var(--t2); }
.sect-lbl { font-family: var(--mono); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: var(--t2); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); display: block; }
.node-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px; margin-bottom: 28px; }
.node-card { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r3); padding: 18px; transition: border-color .15s; }
.node-card:hover { border-color: var(--line2); }
.node-card.offline { opacity: .35; }
.nch { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.nch-left { display: flex; align-items: center; gap: 9px; }
.nc-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.nc-dot.online  { background: var(--grn2); box-shadow: 0 0 8px rgba(72,204,132,.4); }
.nc-dot.offline { background: var(--t3); }
.nc-name { font-size: 13px; font-weight: 600; color: var(--t0); }
.nc-loc  { font-family: var(--mono); font-size: 9px; color: var(--t2); margin-top: 2px; }
.nc-badge { font-family: var(--mono); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: var(--r); border: 1px solid var(--line2); color: var(--t2); background: var(--bg2); }
.nc-badge.online { color: var(--grn2); border-color: rgba(72,204,132,.15); background: rgba(72,204,132,.04); }
.nc-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-bottom: 12px; }
.nc-stat { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r2); padding: 9px 7px; text-align: center; }
.nc-stat-val { font-size: 14px; font-weight: 600; color: var(--t0); margin-bottom: 2px; }
.nc-stat-lbl { font-family: var(--mono); font-size: 7px; color: var(--t2); letter-spacing: .1em; text-transform: uppercase; }
.nc-sys { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 10px; }
.nc-tag { font-family: var(--mono); font-size: 9px; color: var(--t2); background: var(--bg2); border: 1px solid var(--line); padding: 2px 7px; border-radius: var(--r); }
.uptime-bar { margin-top: 4px; }
.uptime-bar-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 8px; color: var(--t2); margin-bottom: 5px; }
.uptime-bar-track { height: 2px; background: var(--bg4); border-radius: 1px; overflow: hidden; }
.uptime-bar-fill { height: 100%; border-radius: 1px; transition: width 1.4s cubic-bezier(.16,1,.3,1); }
.uptime-bar-fill.online  { background: var(--grn2); }
.uptime-bar-fill.offline { background: var(--t3); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 28px; }
.info-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r2); }
.info-row-key { font-family: var(--mono); font-size: 8px; color: var(--t2); letter-spacing: .1em; text-transform: uppercase; }
.info-row-val { font-family: var(--mono); font-size: 10px; color: var(--t1); }
.status-loading { display: flex; align-items: center; justify-content: center; height: 200px; font-family: var(--mono); font-size: 10px; color: var(--t2); gap: 10px; letter-spacing: .1em; }
.status-spinner { width: 12px; height: 12px; border: 1.5px solid var(--line3); border-top-color: var(--t1); border-radius: 50%; animation: spin .8s linear infinite; }

/* ══ NODES PAGE ══════════════════════════════════════════════════════════ */
.nodes-page { display: none; flex: 1; overflow-y: auto; padding: 28px; background: var(--bg); }
.nodes-page.visible { display: block; }
.node-row { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r3); padding: 14px 18px; display: flex; align-items: center; gap: 12px; transition: border-color .15s, transform .12s; margin-bottom: 4px; }
.node-row:hover { border-color: var(--line2); transform: translateX(2px); }
.node-row-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.node-row-dot.online  { background: var(--grn2); box-shadow: 0 0 6px rgba(72,204,132,.35); }
.node-row-dot.offline { background: var(--t3); }
.node-row-info { flex: 1; min-width: 0; }
.node-row-name { font-size: 13px; font-weight: 600; color: var(--t0); margin-bottom: 2px; }
.node-row-meta { font-family: var(--mono); font-size: 9px; color: var(--t2); }
.node-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.add-node-form { background: var(--bg1); border: 1px solid var(--line2); border-radius: var(--r3); padding: 20px; margin-top: 4px; }
.add-node-title { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--t2); text-transform: uppercase; margin-bottom: 14px; }
.add-node-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-node-full { grid-column: 1/-1; }

/* ══ STATUSBAR ══════════════════════════════════════════════════════════ */
.statusbar { height: 22px; background: var(--bg1); border-top: 1px solid var(--line); padding: 0 14px; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.sb-stat { font-family: var(--mono); font-size: 8px; color: var(--t3); }
.sb-stat b { color: var(--t2); font-weight: 500; }
.sb-right { margin-left: auto; }

/* ══ UPLOAD PROGRESS ════════════════════════════════════════════════════ */
.uprog { position: fixed; bottom: 24px; right: 16px; width: 264px; background: var(--bg3); border: 1px solid var(--line3); border-radius: var(--r3); padding: 14px 16px; display: none; z-index: 600; box-shadow: var(--shadow); }
.uprog.visible { display: block; animation: fadeUp .2s cubic-bezier(.16,1,.3,1); }
.uprog-name { font-size: 12px; font-weight: 600; color: var(--t0); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uprog-sub  { font-family: var(--mono); font-size: 9px; color: var(--t2); margin-bottom: 10px; }
.uprog-track { height: 2px; background: var(--bg5); border-radius: 1px; overflow: hidden; }
.uprog-fill  { height: 100%; background: var(--t0); width: 0%; border-radius: 1px; transition: width .1s ease; }
.uprog-pct  { font-family: var(--mono); font-size: 9px; color: var(--t2); text-align: right; margin-top: 5px; }

/* ══ CONTEXT MENU ═══════════════════════════════════════════════════════ */
.ctx { position: fixed; background: var(--bg3); border: 1px solid var(--line3); border-radius: var(--r3); padding: 4px; min-width: 168px; z-index: 9000; box-shadow: var(--shadow2); display: none; }
.ctx.open { display: block; animation: ctxIn .12s cubic-bezier(.16,1,.3,1); }
@keyframes ctxIn { from { opacity:0; transform:scale(.96) translateY(-4px); } to { opacity:1; transform:scale(1) translateY(0); } }
.ctx-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r); cursor: pointer; font-size: 12px; color: var(--t1); font-weight: 500; transition: background .07s, color .07s; user-select: none; }
.ctx-item:hover { background: var(--bg4); color: var(--t0); }
.ctx-item.danger { color: var(--red2); }
.ctx-item.danger:hover { background: rgba(224,85,85,.07); }
.ctx-item svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .4; }
.ctx-sep { height: 1px; background: var(--line2); margin: 3px 0; }

/* ══ TOAST ══════════════════════════════════════════════════════════════ */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 8px 14px; background: var(--bg4); border: 1px solid var(--line3); border-radius: var(--r2); font-family: var(--mono); font-size: 10px; color: var(--t0); display: none; z-index: 9999; box-shadow: var(--shadow); white-space: nowrap; }
.toast.show { display: flex; align-items: center; gap: 8px; animation: ctxIn .14s cubic-bezier(.16,1,.3,1); }
.toast.success { border-color: rgba(72,204,132,.2); }
.toast.error   { border-color: rgba(224,85,85,.2); }
.tdot { width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0; }
.toast.success .tdot { background: var(--grn2); }
.toast.error   .tdot { background: var(--red2); }

/* ══ MODALS ═════════════════════════════════════════════════════════════ */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.overlay.open { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--line3); border-radius: var(--r4); width: 100%; max-width: 400px; overflow: hidden; animation: modalIn .2s cubic-bezier(.16,1,.3,1); box-shadow: var(--shadow2); }
@keyframes modalIn { from { opacity:0; transform:scale(.96) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-wide { max-width: 560px; }
.modal-xl   { max-width: 820px; }
.mhead { padding: 16px 20px; border-bottom: 1px solid var(--line2); font-size: 13px; font-weight: 600; color: var(--t0); display: flex; align-items: center; gap: 8px; }
.mbody { padding: 20px; }
.mfoot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 6px; background: rgba(0,0,0,.12); }
.minput { width: 100%; padding: 10px 12px; background: var(--bg3); border: 1px solid var(--line2); color: var(--t0); font-size: 13px; font-family: var(--sans); font-weight: 400; outline: none; border-radius: var(--r2); transition: border-color .14s; margin-bottom: 8px; }
.minput:focus { border-color: var(--line3); }
.minput:last-child { margin-bottom: 0; }
.minput::placeholder { color: var(--t3); }
.mdesc { font-size: 13px; color: var(--t1); line-height: 1.7; }
.mdesc strong { color: var(--t0); font-weight: 600; }
.mselect { width: 100%; padding: 10px 12px; background: var(--bg3); border: 1px solid var(--line2); color: var(--t0); font-size: 12px; font-family: var(--sans); outline: none; border-radius: var(--r2); margin-bottom: 8px; }
.mselect option { background: var(--bg2); }
.mbtn { height: 32px; display: inline-flex; align-items: center; gap: 4px; padding: 0 14px; background: var(--bg3); border: 1px solid var(--line2); color: var(--t1); font-size: 12px; font-family: var(--sans); font-weight: 500; cursor: pointer; border-radius: var(--r2); transition: all .1s; }
.mbtn:hover { background: var(--bg4); border-color: var(--line3); color: var(--t0); }
.mbtn.primary { background: var(--t0); border-color: var(--t0); color: var(--bg); font-weight: 600; }
.mbtn.primary:hover { background: var(--ac2); border-color: var(--ac2); }
.mbtn.danger { color: var(--red2); }
.mbtn.danger:hover { border-color: rgba(224,85,85,.2); background: rgba(224,85,85,.06); }
.editor-ta { width: 100%; min-height: 400px; background: var(--bg1); border: 1px solid var(--line2); color: var(--t0); padding: 16px; font-family: var(--mono); font-size: 12px; line-height: 1.9; resize: vertical; outline: none; border-radius: var(--r2); transition: border-color .12s; }
.editor-ta:focus { border-color: var(--line3); }
.user-tbl { width: 100%; border-collapse: collapse; }
.user-tbl th { font-family: var(--mono); font-size: 8px; color: var(--t2); letter-spacing: .1em; text-transform: uppercase; text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.user-tbl td { font-size: 12px; color: var(--t1); padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.user-tbl tr:last-child td { border-bottom: none; }
.user-tbl tr:hover td { background: rgba(255,255,255,.01); }
.rbadge { display: inline-block; padding: 2px 7px; border-radius: var(--r); font-size: 8px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-family: var(--mono); border: 1px solid var(--line); }
.rbadge.admin { background: var(--bg4); color: var(--t0); border-color: var(--line3); }
.rbadge.user  { background: var(--bg3); color: var(--t2); }
.add-form { display: grid; grid-template-columns: 1fr 1fr 85px auto; gap: 5px; align-items: end; margin-top: 12px; }
.add-form .minput, .add-form .mselect { margin: 0; }
.form-err { font-family: var(--mono); font-size: 9px; color: var(--red2); margin-top: 6px; display: none; }
.sect-title { font-family: var(--mono); font-size: 8px; color: var(--t2); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-weight: 600; }
.sect-title--warn { color: var(--red2); border-color: rgba(224,85,85,.15); }
.upload-input { display: none; }

/* ══ ADMIN PANEL ════════════════════════════════════════════════════════ */
.admin-tabs { display: flex; border-bottom: 1px solid var(--line2); padding: 0 16px; gap: 0; }
.admin-tab { height: 42px; padding: 0 16px; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--t2); font-size: 12px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: all .12s; margin-bottom: -1px; }
.admin-tab:hover { color: var(--t1); }
.admin-tab.active { color: var(--t0); border-bottom-color: var(--t0); }
.admin-panel { max-height: 64vh; overflow-y: auto; }

/* Node list inside admin */
.admin-node-list { display: flex; flex-direction: column; gap: 4px; }
.admin-node-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg3); border: 1px solid var(--line2); border-radius: var(--r2); transition: border-color .12s; }
.admin-node-row:hover { border-color: var(--line3); }
.admin-node-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.admin-node-dot.online  { background: var(--grn2); box-shadow: 0 0 6px rgba(72,204,132,.4); }
.admin-node-dot.offline { background: var(--t3); }
.admin-node-info { flex: 1; min-width: 0; }
.admin-node-name { font-size: 12px; font-weight: 600; color: var(--t0); margin-bottom: 1px; }
.admin-node-meta { font-family: var(--mono); font-size: 8px; color: var(--t2); }
.admin-node-actions { display: flex; gap: 5px; flex-shrink: 0; align-items: center; }
.node-maint-btn { height: 28px; padding: 0 10px; background: var(--bg4); border: 1px solid var(--line2); color: var(--t2); font-size: 10px; font-family: var(--sans); font-weight: 500; cursor: pointer; border-radius: var(--r); transition: all .12s; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.node-maint-btn:hover { border-color: var(--line3); color: var(--t1); }
.node-maint-btn.active { background: rgba(212,136,48,.08); border-color: rgba(212,136,48,.25); color: var(--amber); }
.node-maint-btn svg { opacity: .5; }
.node-maint-btn.active svg { opacity: 1; }

/* Maintenance card in System tab */
.maintenance-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--bg3); border: 1px solid var(--line2); border-radius: var(--r2); }
.maintenance-card-title { font-size: 13px; font-weight: 600; color: var(--t0); margin-bottom: 4px; }
.maintenance-card-desc  { font-size: 11px; color: var(--t2); line-height: 1.6; max-width: 320px; }

/* Toggle switch */
.toggle-btn { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; flex-shrink: 0; padding: 0; }
.toggle-track { width: 40px; height: 22px; background: var(--bg5); border: 1px solid var(--line3); border-radius: 11px; position: relative; transition: background .2s, border-color .2s; flex-shrink: 0; }
.toggle-btn.toggle-on .toggle-track { background: var(--t0); border-color: var(--t0); }
.toggle-thumb { position: absolute; width: 16px; height: 16px; background: var(--t2); border-radius: 50%; top: 2px; left: 2px; transition: transform .2s, background .2s; }
.toggle-btn.toggle-on .toggle-thumb { transform: translateX(18px); background: var(--bg); }
.toggle-label { font-family: var(--mono); font-size: 10px; color: var(--t2); letter-spacing: .05em; min-width: 20px; transition: color .2s; }
.toggle-btn.toggle-on .toggle-label { color: var(--t0); }

/* ══ SUSPEND MODAL ══════════════════════════════════════════════════════ */
.modal-suspend { max-width: 440px; }
.suspend-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 20px 0; margin-bottom: 0;
}
.suspend-icon {
  width: 38px; height: 38px; border-radius: var(--r2); flex-shrink: 0;
  background: rgba(224,85,85,.08); border: 1px solid rgba(224,85,85,.18);
  display: flex; align-items: center; justify-content: center;
  color: var(--red2);
}
.suspend-icon svg { width: 16px; height: 16px; }
.suspend-title { font-size: 14px; font-weight: 700; color: var(--t0); margin-bottom: 4px; }
.suspend-sub { font-size: 11px; color: var(--t2); line-height: 1.5; }
.suspend-user-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg3);
  border: 1px solid var(--line2); border-radius: var(--r2);
  margin-bottom: 16px;
}
.suspend-user-av {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg5);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--t0);
  flex-shrink: 0; border: 1px solid var(--line3);
}
.suspend-user-name { font-size: 13px; font-weight: 600; color: var(--t0); margin-bottom: 2px; }
.suspend-user-meta { font-family: var(--mono); font-size: 9px; color: var(--t2); }
.suspend-reason-ta { resize: vertical; min-height: 80px; font-size: 12px; margin-bottom: 8px; }
.suspend-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.suspend-preset {
  font-family: var(--mono); font-size: 9px; padding: 4px 9px;
  background: var(--bg3); border: 1px solid var(--line2); border-radius: var(--r);
  color: var(--t2); cursor: pointer; transition: all .1s; user-select: none;
  letter-spacing: .03em;
}
.suspend-preset:hover { border-color: rgba(224,85,85,.3); color: var(--red2); background: rgba(224,85,85,.05); }
.suspend-confirm-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(224,85,85,.1) !important; border-color: rgba(224,85,85,.25) !important;
  color: var(--red2) !important; font-weight: 600;
}
.suspend-confirm-btn:hover {
  background: rgba(224,85,85,.18) !important; border-color: rgba(224,85,85,.4) !important;
}

/* Suspended badge & row */
.rbadge.suspended { background: rgba(224,85,85,.08); color: var(--red2); border-color: rgba(224,85,85,.2); }
.user-row-suspended td { opacity: .6; }
.suspend-reason-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 8px; color: var(--red2);
  background: rgba(224,85,85,.06); border: 1px solid rgba(224,85,85,.15);
  border-radius: var(--r); padding: 2px 7px; margin-top: 3px; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unsuspend-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; font-size: 10px; font-family: var(--sans); font-weight: 500;
  background: rgba(72,204,132,.07); border: 1px solid rgba(72,204,132,.2);
  color: var(--grn2); border-radius: var(--r2); cursor: pointer; transition: all .12s;
  white-space: nowrap;
}
.unsuspend-btn:hover { background: rgba(72,204,132,.14); border-color: rgba(72,204,132,.35); }

/* Login suspended screen */
.login-suspended {
  display: none; padding: 14px 16px; background: rgba(224,85,85,.05);
  border: 1px solid rgba(224,85,85,.18); border-radius: var(--r2); margin-bottom: 8px;
}
.login-suspended.show { display: block; }
.login-suspended-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--red2); margin-bottom: 6px;
}
.login-suspended-title svg { flex-shrink: 0; }
.login-suspended-reason {
  font-family: var(--mono); font-size: 10px; color: var(--t2);
  line-height: 1.6; padding: 8px 10px; background: var(--bg2);
  border-radius: var(--r); border: 1px solid var(--line2); margin-top: 6px;
}

/* ══ MAINTENANCE SCREEN ═════════════════════════════════════════════════ */
#maintenanceScreen {
  position: fixed; inset: 0; background: var(--bg); z-index: 99999;
  display: none; align-items: center; justify-content: center;
  flex-direction: column;
}
#maintenanceScreen.visible { display: flex; }
.maint-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(255,255,255,.015) 0%, transparent 70%);
}
/* dot grid */
.maint-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--line3) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: .35;
}
.maint-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 40px 24px;
  max-width: 500px; width: 100%;
  opacity: 0; transform: translateY(16px);
  animation: fadeUp .7s .1s cubic-bezier(.16,1,.3,1) forwards;
}
.maint-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 44px; }
.maint-mark { width: 36px; height: 36px; background: var(--t0); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--bg); }
.maint-wordmark { font-size: 14px; font-weight: 700; color: var(--t0); letter-spacing: -.01em; }
.maint-wordmark b { color: var(--t0); }
.maint-divider { width: 40px; height: 1px; background: var(--line3); margin-bottom: 36px; }
.maint-title { font-size: 34px; font-weight: 300; color: var(--t0); line-height: 1.15; letter-spacing: -.03em; margin-bottom: 18px; }
.maint-title span { font-weight: 700; }
.maint-body { font-size: 13px; color: var(--t2); line-height: 1.75; margin-bottom: 40px; max-width: 380px; }
.maint-contacts { width: 100%; margin-bottom: 40px; }
.maint-contact-label { font-family: var(--mono); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--t3); margin-bottom: 12px; }
.maint-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.maint-contact { background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r2); padding: 14px 16px; text-align: left; }
.maint-contact-name { font-size: 13px; font-weight: 600; color: var(--t0); margin-bottom: 5px; }
.maint-contact-email { font-family: var(--mono); font-size: 10px; color: var(--t2); text-decoration: none; transition: color .12s; word-break: break-all; }
.maint-contact-email:hover { color: var(--t0); }
.maint-footer { font-family: var(--mono); font-size: 9px; color: var(--t3); letter-spacing: .06em; }

/* ══ SPLASH ═════════════════════════════════════════════════════════════ */
#splashScreen { position: fixed; inset: 0; background: var(--bg); z-index: 99999; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#splashScreen.splash-out { animation: splashExit .6s cubic-bezier(.7,0,.3,1) forwards; }
@keyframes splashExit { 0% { opacity:1; } 100% { opacity:0; pointer-events:none; } }
#splashCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.splash-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.splash-content > * { opacity: 0; transform: translateY(10px); }
.splash-content > *:nth-child(1) { animation: fadeUp .5s .08s cubic-bezier(.16,1,.3,1) forwards; }
.splash-content > *:nth-child(2) { animation: fadeUp .5s .14s cubic-bezier(.16,1,.3,1) forwards; }
.splash-content > *:nth-child(3) { animation: fadeUp .5s .22s cubic-bezier(.16,1,.3,1) forwards; }
.splash-content > *:nth-child(4) { animation: fadeUp .5s .30s cubic-bezier(.16,1,.3,1) forwards; }
.splash-content > *:nth-child(5) { animation: fadeUp .5s .36s cubic-bezier(.16,1,.3,1) forwards; }
.splash-content > *:nth-child(6) { animation: fadeUp .4s .44s cubic-bezier(.16,1,.3,1) forwards; }
.splash-mark { width: 48px; height: 48px; background: var(--t0); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; animation: fadeUp .5s .08s cubic-bezier(.16,1,.3,1) forwards, markPulse 3s 1s ease-in-out infinite !important; }
@keyframes markPulse { 0%,100% { box-shadow: none; } 50% { box-shadow: 0 0 40px rgba(240,240,244,.05); } }
.splash-mark span { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--bg); line-height: 1; }
.splash-wordmark { font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--t2); text-transform: uppercase; margin-bottom: 28px; }
.splash-wordmark span { color: var(--t0); }
.splash-rule { width: 1px; height: 32px; background: var(--line3); margin-bottom: 24px; position: relative; overflow: hidden; }
.splash-rule::after { content: ''; position: absolute; top: -100%; left: 0; width: 100%; height: 100%; background: var(--t2); animation: ruleSlide .7s .5s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes ruleSlide { from { top:-100%; } to { top:100%; } }
.splash-status { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; height: 14px; }
.splash-cursor { width: 2px; height: 13px; background: var(--t2); animation: cursorBlink .9s .9s step-end infinite; flex-shrink: 0; }
@keyframes cursorBlink { 0%,100% { opacity:1; } 50% { opacity:0; } }
.splash-text { font-family: var(--mono); font-size: 10px; color: var(--t2); letter-spacing: .15em; text-transform: uppercase; min-width: 160px; }
.splash-bar-track { width: 160px; height: 1px; background: var(--line2); overflow: hidden; margin-bottom: 24px; }
.splash-bar-fill { height: 100%; width: 0%; background: var(--t0); transition: width .2s cubic-bezier(.16,1,.3,1); }
.splash-build { font-family: var(--mono); font-size: 9px; color: var(--t3); letter-spacing: .15em; text-transform: uppercase; }

/* ══ LOGIN SUCCESS ══════════════════════════════════════════════════════ */
@keyframes loginSuccessOut { 0% { opacity:1; transform:translateY(0); } 100% { opacity:0; transform:translateY(-24px); } }
@keyframes loginSuccessBg  { 0% { opacity:1; } 100% { opacity:0; } }
.login-wrap.login-exiting { animation: loginSuccessBg .45s ease forwards; pointer-events: none; }
.login-wrap.login-exiting .login-card { animation: loginSuccessOut .45s ease forwards; }
@keyframes btnSuccessPulse { 0% { box-shadow: 0 0 0 0 rgba(72,204,132,.4); } 60% { box-shadow: 0 0 0 10px rgba(72,204,132,0); } 100% { box-shadow: 0 0 0 0 rgba(72,204,132,0); } }
.login-btn.btn-success { background: var(--grn) !important; color: #fff !important; animation: btnSuccessPulse .5s ease-out forwards; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ══ MOBILE ═════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .login-h { font-size: 36px; }
  .login-card { padding: 0 24px; }
  .topbar { padding: 0 10px; gap: 4px; overflow: hidden; }
  .logo { font-size: 11px; gap: 6px; flex-shrink: 0; }
  .logo-mark { width: 22px; height: 22px; }
  .node-pill { flex: 1; min-width: 0; max-width: 170px; }
  .node-pill select { min-width: 0; flex: 1; font-size: 10px; }
  .uchip { display: none; }
  #adminBtn { display: none !important; }
  .tbtn { height: 28px; padding: 0 8px; font-size: 10px; }
  .body { padding-bottom: 54px; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 54px; background: var(--bg1); border-top: 1px solid var(--line2); z-index: 200; align-items: stretch; }
  .mobile-nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: none; border: none; color: var(--t2); font-family: var(--mono); font-size: 7px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: color .1s; padding: 0; position: relative; }
  .mobile-nav-btn svg { width: 17px; height: 17px; }
  .mobile-nav-btn.active { color: var(--t0); }
  .mobile-nav-btn.active::before { content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 1px; background: var(--t0); opacity: .35; }
  .mobile-nav-btn:active { background: var(--bg2); }
  .mobile-fab { display: flex; position: fixed; bottom: 66px; right: 14px; width: 46px; height: 46px; background: var(--t0); border: none; border-radius: 50%; align-items: center; justify-content: center; cursor: pointer; z-index: 201; box-shadow: 0 4px 20px rgba(0,0,0,.6); transition: all .1s; }
  .mobile-fab:active { transform: scale(.93); }
  .mobile-fab svg { width: 17px; height: 17px; color: var(--bg); }
  .action-bar { padding: 5px 10px; overflow-x: auto; flex-wrap: nowrap; gap: 2px; scrollbar-width: none; }
  .action-bar::-webkit-scrollbar { display: none; }
  #uploadBtn { display: none; }
  .abar-btn { height: 28px; flex-shrink: 0; }
  .search-input { width: 110px; }
  .search-input:focus { width: 140px; }
  .breadcrumb { padding: 0 10px; }
  #currentPathEl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; display: inline-block; }
  .file-area { padding: 10px; }
  .file-grid { grid-template-columns: repeat(2, 1fr); }
  .fl-date, .fl-size { display: none; }
  .statusbar { display: none; }
  .uprog { bottom: 64px; right: 10px; left: 10px; width: auto; }
  .toast { bottom: 64px; max-width: calc(100vw - 28px); white-space: normal; text-align: center; }
  .ctx { position: fixed; bottom: 54px; left: 0; right: 0; top: auto; min-width: unset; width: 100%; border-radius: var(--r3) var(--r3) 0 0; border-left: none; border-right: none; border-bottom: none; padding: 6px 0 4px; box-shadow: 0 -8px 40px rgba(0,0,0,.8); animation: ctxSlideUp .16s cubic-bezier(.16,1,.3,1) !important; }
  @keyframes ctxSlideUp { from { transform: translateY(100%); opacity:0; } to { transform: translateY(0); opacity:1; } }
  .ctx-item { padding: 13px 18px; font-size: 14px; }
  .overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: var(--r3) var(--r3) 0 0; max-width: 100%; width: 100%; animation: modalSlideUp .22s cubic-bezier(.16,1,.3,1); max-height: 92vh; overflow-y: auto; }
  @keyframes modalSlideUp { from { transform: translateY(100%); opacity:0; } to { transform: translateY(0); opacity:1; } }
  .editor-ta { min-height: 50vh; }
  .modal-xl, .modal-wide { max-width: 100%; }
  .add-form { grid-template-columns: 1fr 1fr; }
  .add-form .mbtn { grid-column: 1/-1; }
  .status-page, .nodes-page { padding: 14px 12px 24px; }
  .pg-header { flex-direction: column; gap: 8px; margin-bottom: 18px; padding-bottom: 14px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .node-cards, .info-grid { grid-template-columns: 1fr; }
  .add-node-grid { grid-template-columns: 1fr; }
  .add-node-full { grid-column: 1; }
  .node-row { flex-wrap: wrap; gap: 8px; }
  .node-row-actions { width: 100%; justify-content: flex-end; }
  .maint-contact-grid { grid-template-columns: 1fr; }
  .maint-title { font-size: 26px; }
}
@media (min-width: 769px) { .mobile-nav, .mobile-fab { display: none; } }

/* ══ MAINTENANCE ADMIN ACTIONS ═══════════════════════════════════════════ */
.maint-admin-actions {
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 8px; width: 100%;
}
.maint-admin-sep { width: 40px; height: 1px; background: var(--line3); }
.maint-admin-label { font-family: var(--mono); font-size: 9px; color: var(--t3); letter-spacing: .1em; text-transform: uppercase; }
.maint-admin-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; background: transparent;
  border: 1px solid var(--line3); border-radius: var(--r2);
  color: var(--t2); font-size: 12px; font-family: var(--sans); font-weight: 500;
  cursor: pointer; transition: all .14s;
}
.maint-admin-btn:hover { border-color: var(--red2); color: var(--red2); background: rgba(224,85,85,.05); }

/* maintenance password form */
.maint-pw-form {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 320px;
}
.maint-pw-input {
  width: 100%; padding: 10px 13px; background: var(--bg2); border: 1px solid var(--line2);
  border-radius: var(--r2); color: var(--t0); font-size: 13px; font-family: var(--sans);
  outline: none; text-align: center; transition: border-color .15s;
}
.maint-pw-input:focus { border-color: var(--line3); }
.maint-pw-input::placeholder { color: var(--t3); font-size: 12px; }
.maint-pw-btn {
  width: 100%; padding: 10px; background: var(--bg2); border: 1px solid var(--line2);
  border-radius: var(--r2); color: var(--t1); font-size: 12px; font-family: var(--sans);
  font-weight: 500; cursor: pointer; transition: all .14s;
}
.maint-pw-btn:hover { border-color: var(--line3); color: var(--t0); background: var(--bg3); }
.maint-pw-err { font-family: var(--mono); font-size: 9px; color: var(--red2); min-height: 14px; }
.maint-admin-btn--primary {
  background: rgba(240,240,244,.06) !important;
  border-color: rgba(240,240,244,.2) !important;
  color: var(--t0) !important;
}
.maint-admin-btn--primary:hover {
  background: rgba(240,240,244,.12) !important;
  border-color: rgba(240,240,244,.35) !important;
}

/* ══ ANNOUNCEMENT BANNER ════════════════════════════════════════════════ */
#announcementBanner {
  flex-shrink: 0; display: flex; flex-direction: column; gap: 1px;
  border-bottom: 1px solid var(--line);
}
.ann-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 12px; font-weight: 500;
  position: relative;
}
.ann-banner--info    { background: rgba(80,80,120,.18); color: var(--t0); border-left: 3px solid var(--ac3); }
.ann-banner--warning { background: rgba(212,136,48,.1);  color: var(--amber); border-left: 3px solid var(--amber); }
.ann-banner--error   { background: rgba(224,85,85,.1);   color: var(--red2);  border-left: 3px solid var(--red2); }
.ann-banner-icon { flex-shrink: 0; opacity: .7; display: flex; }
.ann-banner-msg  { flex: 1; line-height: 1.5; }
.ann-banner-meta { font-family: var(--mono); font-size: 8px; opacity: .45; white-space: nowrap; flex-shrink: 0; }
.ann-banner-dismiss {
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: inherit; opacity: .4;
  border-radius: var(--r); font-size: 11px; transition: opacity .1s; flex-shrink: 0;
}
.ann-banner-dismiss:hover { opacity: 1; }

/* ══ ANNOUNCEMENT ADMIN PANEL ═══════════════════════════════════════════ */
.ann-compose { resize: vertical; min-height: 72px; font-size: 12px; }
.ann-type-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ann-type-label { font-family: var(--mono); font-size: 9px; color: var(--t2); letter-spacing: .1em; text-transform: uppercase; }
.ann-type-sel { width: auto; padding: 6px 10px; margin: 0; }
.ann-admin-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg3); border: 1px solid var(--line2); border-radius: var(--r2);
  margin-bottom: 4px;
}
.ann-admin-row--warning { border-left: 3px solid var(--amber); }
.ann-admin-row--error   { border-left: 3px solid var(--red2); }
.ann-admin-row--info    { border-left: 3px solid var(--ac3); }
.ann-admin-type {
  font-family: var(--mono); font-size: 7px; letter-spacing: .1em;
  padding: 2px 6px; border-radius: var(--r); border: 1px solid var(--line3);
  flex-shrink: 0; font-weight: 700;
}
.ann-type-dot--info    { color: var(--t1); }
.ann-type-dot--warning { color: var(--amber); border-color: rgba(212,136,48,.3); }
.ann-type-dot--error   { color: var(--red2);  border-color: rgba(224,85,85,.3); }
.ann-admin-msg  { flex: 1; font-size: 12px; color: var(--t0); }
.ann-admin-meta { font-family: var(--mono); font-size: 8px; color: var(--t2); flex-shrink: 0; }

@media (max-width: 768px) {
  .ann-banner { padding: 8px 12px; gap: 8px; }
  .ann-banner-meta { display: none; }
  .ann-admin-row { flex-wrap: wrap; gap: 6px; }
}