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

:root {
  color-scheme: dark;
  
  /* Cyber Palette */
  --bg: #06090e;
  --bg-subtle: #0a0f18;
  --panel: rgba(12, 19, 30, 0.85);
  --panel2: #121c2d;
  --panel-active: rgba(0, 240, 255, 0.08);
  --border: rgba(0, 240, 255, 0.15);
  --border-glow: rgba(0, 240, 255, 0.35);
  --border-dark: #1b283d;
  
  --text: #e2ecf9;
  --text-dim: #cad5e8;
  --muted: #647b99;
  
  /* Neon Accents */
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.4);
  --green: #00ff75;
  --green-glow: rgba(0, 255, 117, 0.4);
  --red: #ff2d55;
  --red-glow: rgba(255, 45, 85, 0.4);
  --amber: #ffb800;
  --amber-glow: rgba(255, 184, 0, 0.4);
  --purple: #8b5cf6;
  
  /* Aliases for compatibility */
  --accent: var(--cyan);
  --accent2: #0284c7;
  --success: var(--green);
  --danger: var(--red);
  --warning: var(--amber);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  --font-display: 'Rajdhani', 'Fira Code', sans-serif;
}

* {
  box-sizing: border-box;
}

/* Background grid styling */
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(0, 255, 117, 0.02) 0%, transparent 40%),
    linear-gradient(rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 28px 28px, 28px 28px;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 9, 14, 0.8);
}
::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 3px;
  border: 1px solid var(--border);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

button, input, select {
  font: inherit;
  outline: none;
}
button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.82rem;
}

code {
  font-family: var(--font-mono);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: var(--cyan);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 15, 24, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(0, 240, 255, 0.15);
}

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

.topbar strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.topbar-raven-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #000;
  border: 1.5px solid rgba(0, 240, 255, 0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.topbar-raven-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.topbar-brand:hover .topbar-raven-wrap {
  transform: rotate(-6deg) scale(1.12);
  border-color: var(--green);
  box-shadow: 0 0 16px var(--green-glow), 0 0 25px rgba(0, 240, 255, 0.6);
}

.topbar-brand:hover .topbar-raven-img {
  filter: brightness(1.15);
}

.brand-titles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.brand-dev {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--green);
    background: rgba(0, 255, 117, 0.08);
    padding: 3px 7px;
    border-radius: 3px;
    border: 1px solid rgba(0, 255, 117, 0.35);
    box-shadow: 0 0 8px rgba(0, 255, 117, 0.12);
    display: inline-flex;
    align-items: center;
    width: fit-content;
    white-space: nowrap;
}

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

/* Operator Badge */
.operator-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  background: rgba(14, 23, 36, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.05), 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.operator-badge:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}

.operator-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  position: relative;
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

.operator-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.operator-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.operator-name {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.btn-payloads {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
  font-weight: 700;
}

.btn-payloads:hover {
  background: var(--cyan);
  color: #04070b;
  box-shadow: 0 0 20px var(--cyan-glow);
  transform: translateY(-1px);
}

.btn-logout {
  border: 1px solid rgba(255, 45, 85, 0.35);
  color: var(--text-dim);
  background: rgba(255, 45, 85, 0.06);
}

.btn-logout:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 0 16px var(--red-glow);
}

/* ==========================================================================
   LAYOUT & SIDEBAR
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(8, 12, 19, 0.95);
  backdrop-filter: blur(10px);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-dark);
  background: rgba(14, 22, 34, 0.5);
}

.sidebar-head strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  display: block;
}

.sidebar-head .muted {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.agent-list {
  padding: 12px 10px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-dark);
  background: rgba(14, 22, 34, 0.4);
}

.sidebar-payloads-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.agent-item {
  width: 100%;
  border: 1px solid var(--border-dark);
  background: rgba(14, 22, 35, 0.7);
  color: inherit;
  text-align: left;
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.agent-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: all 0.2s ease;
}

.agent-item:hover {
  background: rgba(0, 240, 255, 0.05);
  border-color: var(--border-glow);
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.08);
}

.agent-item.selected {
  background: rgba(0, 240, 255, 0.09);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.15), inset 0 0 12px rgba(0, 240, 255, 0.05);
}

.agent-item.selected::before {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.agent-copy {
  display: grid;
  min-width: 0;
}

.agent-copy strong {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.agent-copy small {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-item.selected .agent-copy small {
  color: rgba(0, 240, 255, 0.8);
}

/* Dots & Status */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a4a5e;
  position: relative;
  transition: all 0.3s ease;
}

.dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
}

.dot.online::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--green);
  opacity: 0.6;
  animation: radar-ripple 2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.dot.offline {
  background: #475569;
}

@keyframes radar-ripple {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 3px var(--green)); }
  50% { opacity: 0.4; filter: none; }
}

.sidebar-empty {
  font-family: var(--font-mono);
  color: var(--muted);
  padding: 30px 16px;
  text-align: center;
  font-size: 0.84rem;
}

/* ==========================================================================
   WORKSPACE & HEADERS
   ========================================================================== */
.workspace {
  min-width: 0;
  padding: 26px 30px;
}

.empty-state {
  max-width: 580px;
  margin: 90px auto;
  text-align: center;
  padding: 40px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: "⚡ NODE_SCANNER";
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  color: #fff;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

/* Device Head */
.device-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-dark);
}

.eyebrow {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-transform: uppercase;
}

.device-head h1 {
  font-family: var(--font-display);
  margin: 4px 0 6px;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

#deviceMeta {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--muted);
}

.status-pill {
  font-family: var(--font-mono);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 7px 16px;
  border-radius: 6px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-pill.online {
  background: rgba(0, 255, 117, 0.12);
  border: 1px solid var(--green);
  color: var(--green);
  box-shadow: 0 0 14px var(--green-glow);
}

.status-pill.offline {
  background: rgba(255, 45, 85, 0.12);
  border: 1px solid var(--red);
  color: var(--red);
  box-shadow: 0 0 14px var(--red-glow);
}

/* ==========================================================================
   TABS
   ========================================================================== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-dark);
}

.tab {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.tab:hover {
  color: var(--text);
  background: rgba(18, 28, 45, 0.4);
  border-color: var(--border-dark);
}

.tab.active {
  background: rgba(0, 240, 255, 0.08);
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.12), inset 0 0 8px rgba(0, 240, 255, 0.05);
}

.tab-panel {
  padding-top: 22px;
  animation: fadeInPanel 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInPanel {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ACTION GRID (GENERAL)
   ========================================================================== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card-action {
  min-height: 96px;
  text-align: left;
  color: inherit;
  border: 1px solid var(--border-dark);
  background: var(--panel);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.card-action::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 16px 16px 0;
  border-color: transparent var(--border-dark) transparent transparent;
  transition: all 0.2s ease;
}

.card-action:hover {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.15);
}

.card-action:hover::before {
  border-color: transparent var(--cyan) transparent transparent;
}

.card-action strong {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-action strong::before {
  content: ">_";
  font-size: 0.8rem;
  color: var(--text-dim);
}

.card-action span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

/* ==========================================================================
   CONSOLE & TERMINAL OUTPUTS
   ========================================================================== */
.output, .terminal-output {
  background: #04070c;
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 16px 0 0;
  min-height: 200px;
  max-height: 55vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: #00ff75;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.8), 0 4px 16px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Terminal Scanline effect */
.output::after, .terminal-output::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.55;
}

.terminal-output {
  min-height: 420px;
  color: #26e6a4;
  border-color: rgba(0, 240, 255, 0.2);
}

/* ==========================================================================
   BUTTONS, INPUTS, CONTROLS
   ========================================================================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

input, select {
  border: 1px solid var(--border-dark);
  background: rgba(10, 16, 26, 0.85);
  color: var(--text);
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 12px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
  background: rgba(14, 24, 38, 0.95);
}

.toolbar input {
  flex: 1 1 280px;
}

.btn {
  border: 1px solid var(--border-dark);
  background: var(--panel2);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 16px;
  min-height: 40px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}

.btn.primary {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.btn.primary:hover {
  background: var(--cyan);
  color: #06090e;
  box-shadow: 0 0 20px var(--cyan-glow);
}

.btn.danger {
  background: rgba(255, 45, 85, 0.15);
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.2);
}

.btn.danger:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 20px var(--red-glow);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  text-decoration: none;
}

.btn.ghost:hover {
  color: var(--red);
  background: rgba(255, 45, 85, 0.1);
  border-color: rgba(255, 45, 85, 0.3);
}

.btn.small {
  font-size: 0.78rem;
  min-height: 32px;
  padding: 4px 10px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none !important;
  box-shadow: none !important;
  border-color: var(--border-dark) !important;
}

/* Command Row (Terminal Prompt) */
.command-row {
  margin-top: 12px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  background: #04070c;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.command-row:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 14px var(--cyan-glow);
}

.command-row input {
  border: 0;
  background: transparent;
  flex: 1;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #fff;
  padding: 4px;
}

.prompt {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

/* ==========================================================================
   PANEL CARDS & TWO COLUMNS
   ========================================================================== */
.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.panel-card {
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  background: var(--panel);
  padding: 20px;
  display: grid;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.panel-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: #fff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-card h3::before {
  content: "▫";
  color: var(--cyan);
}

.panel-card label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   FILE BROWSER
   ========================================================================== */
.file-browser {
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  background: #060a10;
}

.file-row {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: 4px;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.file-row:hover {
  background: rgba(0, 240, 255, 0.08);
  color: #fff;
}

.file-row.folder strong {
  color: var(--cyan);
}

.file-row small {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ==========================================================================
   CAMERA BOX (SURVEILLANCE HUD)
   ========================================================================== */
.camera-box {
  min-height: 360px;
  background: #020407;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 0 16px rgba(0, 240, 255, 0.08);
}

.camera-box::before {
  content: "HUD // OPTICAL_FEED";
  position: absolute;
  top: 10px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  background: rgba(6, 9, 14, 0.85);
  padding: 3px 8px;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  z-index: 10;
}

.camera-box img {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 600px;
  border-radius: 6px;
}

#cameraPlaceholder {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==========================================================================
   ALERTS & NOTIFICATIONS
   ========================================================================== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert.error {
  background: rgba(255, 45, 85, 0.1);
  border: 1px solid rgba(255, 45, 85, 0.4);
  color: #ff6b8b;
  box-shadow: 0 0 14px rgba(255, 45, 85, 0.15);
}

.alert.error::before {
  content: "✕";
  font-weight: 800;
  color: var(--red);
}

.alert.success {
  background: rgba(0, 255, 117, 0.1);
  border: 1px solid rgba(0, 255, 117, 0.4);
  color: #4ade80;
  box-shadow: 0 0 14px rgba(0, 255, 117, 0.15);
}

.alert.success::before {
  content: "✓";
  font-weight: 800;
  color: var(--green);
}

/* ==========================================================================
   AUTHENTICATION & SETUP PAGES (R4v3N MATRIX THEME)
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background-color: #04070b;
}

#matrixCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
}

.auth-card {
  width: min(470px, 100%);
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(8, 14, 23, 0.93);
  backdrop-filter: blur(18px);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 240, 255, 0.15);
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff0055, var(--cyan), var(--green), #ff0055);
  background-size: 300% 100%;
  animation: cyber-gradient-slide 4s linear infinite;
  box-shadow: 0 0 12px var(--cyan-glow);
}

@keyframes cyber-gradient-slide {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.raven-logo-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 20px;
  background: #000;
  border: 1.5px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.4), 0 0 50px rgba(0, 240, 255, 0.15);
  overflow: hidden;
  animation: float-pulse 4s ease-in-out infinite alternate;
}

.raven-logo-wrap img,
.raven-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.raven-logo-wrap:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 35px var(--cyan-glow), 0 0 60px rgba(0, 255, 117, 0.35);
  transform: scale(1.06);
}

.raven-logo-wrap:hover img,
.raven-logo-wrap:hover .raven-img {
  transform: scale(1.24);
  filter: brightness(1.15);
}

@keyframes float-pulse {
  0% {
    transform: translateY(0px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.35), 0 0 40px rgba(0, 240, 255, 0.1);
  }
  50% {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.6), 0 0 55px rgba(0, 255, 117, 0.25);
  }
  100% {
    transform: translateY(0px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.35), 0 0 40px rgba(0, 240, 255, 0.1);
  }
}

/* Hacker Title R4v3N with Glitch Effect */
.hacker-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #00f0ff;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.8), 0 0 24px rgba(0, 240, 255, 0.4);
  position: relative;
  display: inline-block;
  animation: hacker-glow 3s ease-in-out infinite alternate;
}

.hacker-title::before,
.hacker-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hacker-title::before {
  left: 2px;
  text-shadow: -2px 0 #ff0055;
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  animation: glitch-anim-1 2.2s infinite linear alternate-reverse;
}

.hacker-title::after {
  left: -2px;
  text-shadow: 2px 0 #00ff75;
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  animation: glitch-anim-2 2.8s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0%, 100% { clip-path: polygon(0 15%, 100% 15%, 100% 35%, 0 35%); transform: translate(-1px, 1px); }
  25% { clip-path: polygon(0 50%, 100% 50%, 100% 70%, 0 70%); transform: translate(1px, -1px); }
  50% { clip-path: polygon(0 5%, 100% 5%, 100% 25%, 0 25%); transform: translate(-2px, 0); }
  75% { clip-path: polygon(0 80%, 100% 80%, 100% 95%, 0 95%); transform: translate(2px, 1px); }
}

@keyframes glitch-anim-2 {
  0%, 100% { clip-path: polygon(0 65%, 100% 65%, 100% 85%, 0 85%); transform: translate(1px, -1px); }
  25% { clip-path: polygon(0 25%, 100% 25%, 100% 45%, 0 45%); transform: translate(-1px, 1px); }
  50% { clip-path: polygon(0 75%, 100% 75%, 100% 90%, 0 90%); transform: translate(2px, 0); }
  75% { clip-path: polygon(0 35%, 100% 35%, 100% 55%, 0 55%); transform: translate(-2px, -1px); }
}

@keyframes hacker-glow {
  0% { filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6)); }
  50% { filter: drop-shadow(0 0 16px rgba(0, 255, 117, 0.7)) drop-shadow(0 0 28px rgba(0, 240, 255, 0.4)); }
  100% { filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.8)); }
}

.hacker-subtitle {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 10px;
  text-shadow: 0 0 10px var(--green-glow);
  background: rgba(0, 255, 117, 0.08);
  padding: 4px 14px;
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 117, 0.35);
  display: inline-block;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 6px;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.auth-card p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 20px;
}

.auth-card form {
  display: grid;
  gap: 16px;
}

.auth-card label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: -8px;
}

.auth-card.centered label {
  text-align: center;
  display: block;
}

.auth-card input {
  min-height: 46px;
}

.auth-card.centered input {
  text-align: center;
  letter-spacing: 0.08em;
}

.auth-card.centered input::placeholder {
  text-align: center;
  color: #485c75;
}

.auth-card .btn.primary {
  margin-top: 8px;
  min-height: 46px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.login-credits {
  text-align: center;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.8;
  transition: all 0.25s ease;
  user-select: none;
}

.login-credits:hover {
  color: var(--cyan);
  opacity: 1;
  text-shadow: 0 0 10px var(--cyan-glow);
}

/* ==========================================================================
   TACTICAL PAYLOAD MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 10, 0.82);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: min(660px, 100%);
  max-height: 85vh;
  background: rgba(10, 16, 26, 0.96);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(0, 240, 255, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: scaleUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUpModal {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--cyan));
  box-shadow: 0 0 10px var(--cyan-glow);
}

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: rgba(14, 22, 35, 0.6);
}

.modal-head h2 {
  margin: 2px 0 4px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal-close {
  background: rgba(18, 28, 45, 0.6);
  border: 1px solid var(--border-dark);
  color: var(--muted);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 45, 85, 0.2);
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.payload-list {
  display: grid;
  gap: 10px;
}

.payload-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(14, 22, 35, 0.7);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.payload-item:hover {
  background: rgba(0, 240, 255, 0.07);
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.1);
  transform: translateX(3px);
}

.payload-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(18, 28, 45, 0.9);
  border: 1px solid var(--border-dark);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.payload-item:hover .payload-icon {
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
  transform: scale(1.05);
}

.payload-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.payload-info strong {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payload-item:hover .payload-info strong {
  color: var(--cyan);
}

.payload-info small {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 3px;
}

.payload-btn {
  padding: 7px 16px;
  min-height: 36px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-dark);
  background: rgba(8, 12, 19, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .layout {
    display: block;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border-dark);
    max-height: 280px;
  }
  .workspace {
    padding: 16px;
  }
  .two-columns {
    grid-template-columns: 1fr;
  }
  .action-grid {
    grid-template-columns: 1fr 1fr;
  }
  .topbar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .topbar-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .topbar .muted {
    display: none;
  }
}

/* ========================================================================== 
   2026 UI additions: header tools, device deletion, token + mobile WebRTC
   ========================================================================== */
.topbar-tools{display:flex;align-items:center;gap:8px;padding-right:2px}
.topbar-tool{min-height:36px;padding:7px 11px;border-color:rgba(0,240,255,.24);background:rgba(0,240,255,.055);font-family:var(--font-mono);font-size:.76rem;white-space:nowrap}
.topbar-tool:hover{border-color:var(--cyan);background:rgba(0,240,255,.13);box-shadow:0 0 12px rgba(0,240,255,.13)}
.agent-row{display:grid;grid-template-columns:minmax(0,1fr) 32px;gap:6px;align-items:stretch}
.agent-row .agent-item{height:100%}
.agent-delete{border:1px solid rgba(255,45,85,.22);background:rgba(255,45,85,.045);color:#718096;border-radius:8px;cursor:pointer;font-size:.76rem;transition:.2s ease}
.agent-delete:hover{color:white;background:rgba(255,45,85,.75);border-color:var(--red);box-shadow:0 0 12px rgba(255,45,85,.22)}
.compact-modal{max-width:680px}
.token-input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:7px 0 12px}
.token-input-row input,.token-output,#mobilePairUrl{width:100%;box-sizing:border-box;background:#07111b;color:#e8f7ff;border:1px solid #233d4e;border-radius:8px;padding:11px;font-family:var(--font-mono)}
.token-output{min-height:112px;resize:vertical;margin:7px 0 8px;word-break:break-all}
.token-toolbar{margin:4px 0 17px;flex-wrap:wrap}
.qr-wrap{margin-top:16px;padding:16px;border:1px solid rgba(0,240,255,.18);background:rgba(4,12,18,.72);border-radius:12px;text-align:center}
#mobileQrCode{display:inline-block;padding:12px;background:#fff;border-radius:10px;margin-bottom:12px;min-width:230px;min-height:230px}
#mobileQrCode img,#mobileQrCode canvas{display:block;margin:auto}
#mobilePairUrl{text-align:left;margin:6px 0 10px}
.mobile-device-panel{padding:0}
.mobile-screen-box{position:relative;min-height:420px;margin-top:14px;border:1px solid var(--border);border-radius:12px;background:#02070b;display:grid;place-items:center;overflow:hidden}
#mobileRemoteVideo{display:none;width:100%;max-height:72vh;background:#000;object-fit:contain}
#mobileRemoteVideo.active{display:block}
#mobileScreenPlaceholder{color:var(--muted);font-family:var(--font-mono);font-size:.85rem;padding:30px;text-align:center}
@media (max-width:900px){.topbar{align-items:flex-start;padding-top:10px;padding-bottom:10px}.topbar-actions{flex-wrap:wrap;justify-content:flex-end}.topbar-tools{order:2;width:100%;justify-content:flex-end}.topbar-tool{font-size:.7rem}.mobile-screen-box{min-height:280px}}
