/* ═══════════════════════════════════════════════════════════
   NETOPS COMMAND CENTER — STYLESHEET
   Theme: Dark Industrial / Cyber Terminal
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;600;700;800&display=swap');

:root {
  --bg:       #080b0f;
  --bg2:      #0d1117;
  --card:     #111620;
  --card2:    #161d2a;
  --border:   #1e2a3a;
  --border2:  #253347;
  --text:     #e2eaf4;
  --muted:    #5a7090;
  --muted2:   #3d5270;
  --accent:   #00e5ff;
  --accent2:  #00b4cc;
  --green:    #00e59d;
  --red:      #ff4757;
  --yellow:   #ffd32a;
  --orange:   #ff6b35;
  --purple:   #a855f7;
  --sidebar-w: 240px;
  --topbar-h:  56px;
  --radius:    10px;
  --font-mono: 'Space Mono', monospace;
  --font-ui:   'Syne', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── NOISE + SCANLINES ─────────────────────────────────── */
#noise-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
}

#scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
}

/* ── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ── LAYOUT ────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}

#sidebar.collapsed { transform: translateX(-100%); }

#main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin 0.3s;
}

#main.expanded { margin-left: 0; }

/* ── LOGO ──────────────────────────────────────────────── */
.logo {
  padding: 1.5rem 1.25rem 1rem;
  display: flex; align-items: center; gap: 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.logo-icon svg { width: 36px; height: 36px; }

.logo-text {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  color: var(--text);
  display: block;
  line-height: 1;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.18em;
  display: block;
  margin-top: 2px;
}

/* ── NAV ───────────────────────────────────────────────── */
.nav-section-label {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--muted2);
  font-family: var(--font-mono);
}

.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 0;
  transition: all 0.15s;
  position: relative;
  cursor: pointer;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.nav-item.active {
  color: var(--accent);
  background: rgba(0,229,255,0.08);
}

.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ── SIDEBAR FOOTER ────────────────────────────────────── */
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.75rem;
}

.logout-btn {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--muted); text-decoration: none;
  font-size: 0.8rem; font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.logout-btn:hover { color: var(--red); border-color: var(--red); background: rgba(255,71,87,0.08); }
.logout-btn svg { width: 14px; height: 14px; }

.user-info {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; color: var(--muted); font-family: var(--font-mono);
}

.user-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}

/* ── TOPBAR ────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 1.5rem; }

#sidebar-toggle {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 6px; border-radius: 6px; transition: color 0.15s;
}
#sidebar-toggle:hover { color: var(--text); }
#sidebar-toggle svg { width: 18px; height: 18px; display: block; }

#breadcrumb {
  font-family: var(--font-ui); font-weight: 600; font-size: 0.9rem;
  color: var(--text);
}

#clock {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--muted); letter-spacing: 0.05em;
}

#net-status {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; color: var(--muted);
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ── PANELS ────────────────────────────────────────────── */
#panels { flex: 1; }

.panel { display: none; padding: 1.75rem 1.5rem; }
.panel.active { display: block; animation: panel-in 0.25s ease; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PANEL HEADER ──────────────────────────────────────── */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem;
}

.panel-header h1 {
  font-family: var(--font-ui); font-size: 1.4rem; font-weight: 800;
  letter-spacing: -0.01em;
}

.header-sub { color: var(--muted); font-size: 0.82rem; font-weight: 400; margin-top: 2px; }

/* ── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--border2); }

.card-header {
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 1rem;
}

/* ── STATS GRID ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.online-icon  { background: rgba(0,229,157,0.12); color: var(--green); }
.offline-icon { background: rgba(255,71,87,0.12);  color: var(--red); }
.total-icon   { background: rgba(0,229,255,0.12);  color: var(--accent); }
.wol-icon     { background: rgba(255,211,42,0.12); color: var(--yellow); }

.stat-number {
  font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700;
  line-height: 1;
}
.stat-label { font-size: 0.75rem; color: var(--muted); margin-top: 2px; font-weight: 600; }

/* ── DASH GRID ─────────────────────────────────────────── */
.dash-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* ── ACTIVITY / HISTORY LISTS ──────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 360px; overflow-y: auto; }

.activity-item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.activity-item:last-child { border-bottom: none; }

.activity-badge {
  font-family: var(--font-mono); font-size: 0.6rem;
  padding: 2px 6px; border-radius: 4px;
  white-space: nowrap; flex-shrink: 0;
  font-weight: 700; letter-spacing: 0.05em;
}

.badge-wol     { background: rgba(255,211,42,0.15); color: var(--yellow); }
.badge-ping    { background: rgba(0,229,255,0.15);  color: var(--accent); }
.badge-scan    { background: rgba(168,85,247,0.15); color: var(--purple); }
.badge-login   { background: rgba(0,229,157,0.15);  color: var(--green); }
.badge-device  { background: rgba(0,229,255,0.15);  color: var(--accent); }
.badge-terminal{ background: rgba(255,107,53,0.15); color: var(--orange); }
.badge-default { background: rgba(90,112,144,0.2);  color: var(--muted); }

.activity-text { flex: 1; color: var(--text); }
.activity-time { font-family: var(--font-mono); font-size: 0.65rem; color: var(--muted2); white-space: nowrap; }

/* ── QUICK ACTIONS ─────────────────────────────────────── */
.quick-actions { display: flex; flex-direction: column; gap: 0.5rem; }

.quick-wol-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  transition: all 0.15s; color: var(--text); font-size: 0.82rem;
  font-family: var(--font-ui); font-weight: 600;
}
.quick-wol-btn:hover {
  border-color: var(--accent);
  background: rgba(0,229,255,0.06);
  color: var(--accent);
}
.quick-wol-btn .wol-mac { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); }

/* ── TABLE ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}

thead th {
  background: var(--card);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }

tbody td {
  padding: 0.75rem 1rem;
  color: var(--text);
  vertical-align: middle;
}

.td-mono { font-family: var(--font-mono); font-size: 0.75rem; }

/* ── STATUS BADGES ─────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 3px 8px; border-radius: 99px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em;
}
.status-badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
}
.status-online  { background: rgba(0,229,157,0.12); color: var(--green); }
.status-online::before  { background: var(--green); box-shadow: 0 0 4px var(--green); }
.status-offline { background: rgba(255,71,87,0.12);  color: var(--red); }
.status-offline::before { background: var(--red); }
.status-unknown { background: rgba(90,112,144,0.2);  color: var(--muted); }
.status-unknown::before { background: var(--muted); }

/* ── TYPE BADGE ────────────────────────────────────────── */
.type-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0,229,255,0.1); color: var(--accent);
  border: 1px solid rgba(0,229,255,0.15);
}

/* ── BUTTONS ───────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-danger, .btn-warning {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border-radius: 8px;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.04em; cursor: pointer; border: none;
  transition: all 0.15s; white-space: nowrap;
}

.btn-primary {
  background: var(--accent); color: #000;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,229,255,0.3); }

.btn-secondary {
  background: var(--card2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border2); background: var(--card); }

.btn-danger {
  background: rgba(255,71,87,0.15); color: var(--red);
  border: 1px solid rgba(255,71,87,0.3);
}
.btn-danger:hover { background: rgba(255,71,87,0.25); }

.btn-warning {
  background: rgba(255,211,42,0.1); color: var(--yellow);
  border: 1px solid rgba(255,211,42,0.25);
}
.btn-warning:hover { background: rgba(255,211,42,0.2); }

.btn-large { padding: 0.75rem 1.5rem; font-size: 0.9rem; width: 100%; justify-content: center; margin-top: 0.5rem; }

.btn-glow { box-shadow: 0 0 20px rgba(0,229,255,0.15); }
.btn-glow:hover { box-shadow: 0 0 30px rgba(0,229,255,0.35); }

.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--muted);
  width: 30px; height: 30px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; transition: all 0.15s;
  flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon svg { width: 13px; height: 13px; }

.action-btns { display: flex; gap: 0.35rem; align-items: center; }

/* ── FORMS ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block; margin-bottom: 0.4rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}

input[type=text], input[type=number], input[type=password],
input[type=email], textarea, select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-ui); font-size: 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.1);
}

input.mono, textarea.mono { font-family: var(--font-mono); }

textarea { resize: vertical; min-height: 80px; }

select { appearance: none; cursor: pointer; }
select option { background: var(--bg2); }

.form-divider {
  text-align: center; color: var(--muted); font-size: 0.75rem;
  margin: 0.75rem 0; position: relative;
}
.form-divider::before, .form-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 42%; height: 1px; background: var(--border);
}
.form-divider::before { left: 0; }
.form-divider::after  { right: 0; }

.form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.input-btn-row { display: flex; gap: 0.5rem; }
.input-btn-row input { flex: 1; }

/* ── SEARCH BAR ────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.6rem 1rem;
  margin-bottom: 1rem;
}
.search-bar svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.search-bar input {
  background: none; border: none; box-shadow: none; padding: 0;
  width: 100%; font-size: 0.85rem;
}
.search-bar input:focus { box-shadow: none; border-color: transparent; }

/* ── WOL GRID ──────────────────────────────────────────── */
.wol-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .wol-grid { grid-template-columns: 1fr; } }

.history-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 480px; overflow-y: auto; }

.history-item {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.6rem 0.9rem;
  display: grid; grid-template-columns: 1fr auto;
  gap: 0.25rem;
}
.history-mac { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
.history-dev { font-size: 0.78rem; font-weight: 600; }
.history-time { font-family: var(--font-mono); font-size: 0.65rem; color: var(--muted); text-align: right; }
.history-bcast { font-family: var(--font-mono); font-size: 0.65rem; color: var(--muted2); }

/* ── RESULT BOX ────────────────────────────────────────── */
.result-box {
  margin-top: 1rem; padding: 0.75rem 1rem;
  border-radius: 8px; font-family: var(--font-mono); font-size: 0.78rem;
  line-height: 1.5;
}
.result-ok    { background: rgba(0,229,157,0.1);  border: 1px solid rgba(0,229,157,0.25); color: var(--green); }
.result-error { background: rgba(255,71,87,0.1);  border: 1px solid rgba(255,71,87,0.25);  color: var(--red); }

/* ── PROGRESS BAR ──────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--bg2); border-radius: 99px; height: 6px;
  overflow: hidden; margin: 1rem 0 0.5rem;
  border: 1px solid var(--border);
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 99px; width: 0; transition: width 0.3s;
  box-shadow: 0 0 8px rgba(0,229,255,0.4);
}
.progress-text { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

/* ── SCAN CONTROLS ─────────────────────────────────────── */
.scan-controls { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.scan-controls .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }

/* ── TOOLS GRID ────────────────────────────────────────── */
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .tools-grid { grid-template-columns: 1fr; } }

/* ── TERMINAL OUTPUT ───────────────────────────────────── */
.terminal-output {
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--green);
  white-space: pre-wrap; word-break: break-all;
  max-height: 300px; overflow-y: auto;
  line-height: 1.6;
}

/* ── DNS RECORD TYPES ──────────────────────────────────── */
.record-types { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.record-type-btn input { display: none; }
.record-type-btn span {
  display: inline-block; padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 5px;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
  color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.record-type-btn input:checked + span {
  background: rgba(0,229,255,0.12); border-color: var(--accent); color: var(--accent);
}
.record-type-btn span:hover { border-color: var(--border2); color: var(--text); }

/* ── TERMINAL PANEL ────────────────────────────────────── */
.terminal-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono); font-size: 0.78rem;
  min-height: 480px; max-height: 72vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 0.25rem;
  cursor: text;
  line-height: 1.6;
}

.terminal-controls { display: flex; gap: 0.5rem; }

#terminal-output { flex: 1; }

.term-line { color: var(--green); margin-bottom: 1px; white-space: pre-wrap; word-break: break-all; }
.term-prompt { color: var(--accent); font-weight: 700; margin-right: 0.6em; }
.term-welcome { color: var(--muted); }
.term-input-line {
  display: flex; align-items: center; gap: 0; margin-top: 0.4rem;
}
.term-input-line input {
  flex: 1; background: none; border: none; box-shadow: none;
  color: var(--green); font-family: var(--font-mono); font-size: 0.78rem;
  padding: 0; caret-color: var(--accent);
}
.term-input-line input:focus { outline: none; box-shadow: none; border-color: transparent; }

.term-error { color: var(--red); }
.term-cmd   { color: var(--yellow); }
.term-info  { color: var(--muted); }

/* ── FILE MANAGER ──────────────────────────────────────── */
.file-path-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1rem; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 1rem; font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--muted);
}
.file-path-bar svg { width: 14px; height: 14px; flex-shrink: 0; }
#file-current-path { color: var(--accent); }

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.file-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 0.75rem;
  cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.5rem; text-align: center; position: relative;
}
.file-item:hover { border-color: var(--accent); background: rgba(0,229,255,0.04); }

.file-icon { font-size: 2rem; line-height: 1; }
.file-name {
  font-size: 0.72rem; font-weight: 600; color: var(--text);
  word-break: break-all; line-height: 1.3;
}
.file-size { font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted); }

.file-actions {
  position: absolute; top: 4px; right: 4px;
  display: none; gap: 2px;
}
.file-item:hover .file-actions { display: flex; }

.file-action-btn {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--muted); border-radius: 4px;
  width: 22px; height: 22px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: 0.65rem;
  transition: all 0.1s;
}
.file-action-btn:hover { color: var(--red); border-color: var(--red); }

.file-preview {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-top: 1rem;
}
.preview-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent);
}
.preview-header button {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem;
}
#preview-content {
  padding: 1rem; font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text); white-space: pre-wrap; max-height: 400px; overflow-y: auto;
  line-height: 1.6;
}

/* ── MODAL ─────────────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s;
}
#modal-overlay.hidden { display: none; }

#modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: modal-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

#modal-title {
  font-family: var(--font-ui); font-size: 1.1rem; font-weight: 800;
  margin-bottom: 1.25rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ── TOAST ─────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 2000; display: flex; flex-direction: column; gap: 0.5rem;
}

.toast {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.75rem 1.25rem;
  font-size: 0.82rem; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 240px; max-width: 360px;
  display: flex; align-items: center; gap: 0.75rem;
}
.toast-ok     { border-color: rgba(0,229,157,0.4); color: var(--green); }
.toast-error  { border-color: rgba(255,71,87,0.4);  color: var(--red); }
.toast-info   { border-color: rgba(0,229,255,0.4);  color: var(--accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(32px); }
}

/* ── BADGE ─────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 0.65rem; font-weight: 700;
  background: rgba(0,229,255,0.12); color: var(--accent);
  font-family: var(--font-mono);
}

/* ── MISC ──────────────────────────────────────────────── */
.hidden { display: none !important; }

.mono { font-family: var(--font-mono) !important; }

.port-open   { color: var(--green); font-weight: 700; }
.port-closed { color: var(--muted); }

.fadeIn { animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #sidebar { transform: translateX(-240px); width: 240px; }
  #sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,0.5); }
  #main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .wol-grid, .tools-grid { grid-template-columns: 1fr; }
  .panel { padding: 1rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .scan-controls { flex-direction: column; }
}
