:root {
  --bg-primary: #080b11;
  --bg-secondary: #0e131f;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(24, 33, 54, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.3);
  
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #9d4edd;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;

  --text-main: #f1f5f9;
  --text-dim: #94a3b8;
  --text-muted: #64748b;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'Fira Code', monospace;

  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.15);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-ui);
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 242, 254, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(157, 78, 221, 0.05) 0%, transparent 45%);
  min-height: 100vh;
}

.code-font {
  font-family: var(--font-code);
}

.app-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 1.25rem;
}

/* ── Header ────────────────────────────────────────────────────────── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-box {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10192e, #1b2744);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.logo-icon {
  font-size: 1.5rem;
}

.title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title-row h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ffffff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-difficulty {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-category {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}

.status-dot.pulsing {
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.clock-display {
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ── Credentials Bar ───────────────────────────────────────────────── */
.credentials-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: rgba(14, 19, 31, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.cred-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-right: 0.5rem;
}

.cred-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.cred-value {
  color: var(--text-main);
  font-weight: 500;
}

.badge-profile {
  display: inline-block;
  background: rgba(157, 78, 221, 0.2);
  color: #c084fc;
  border: 1px solid rgba(157, 78, 221, 0.4);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Tabs Navigation ───────────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.tab-btn.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
}

/* ── Tab Content Container ─────────────────────────────────────────── */
.main-content {
  flex: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ── Terminal Layout ───────────────────────────────────────────────── */
.terminal-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  height: calc(100vh - 270px);
  min-height: 520px;
}

.terminal-card {
  display: flex;
  flex-direction: column;
  background: #090c14;
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.terminal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #111624;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: var(--text-dim);
}

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

.tool-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.terminal-screen {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ascii-art {
  font-size: 0.65rem;
  line-height: 1.1;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.welcome-text {
  background: rgba(0, 242, 254, 0.03);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.terminal-screen code {
  color: var(--accent-yellow);
  background: rgba(245, 158, 11, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.terminal-line {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.terminal-command {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.terminal-output {
  white-space: pre-wrap;
  word-break: break-all;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.terminal-output.error {
  color: #f87171;
  border-left-color: #ef4444;
}

.terminal-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  align-self: flex-end;
}

.terminal-input-bar {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #101524;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.75rem;
}

.prompt-symbol {
  font-family: var(--font-code);
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 0.95rem;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-code);
  font-size: 0.9rem;
  outline: none;
}

/* ── Sidebar & Command Presets ──────────────────────────────────────── */
.sidebar {
  overflow-y: auto;
}

.sidebar-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
}

.sidebar-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.command-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

.cmd-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

.cmd-preset-btn:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.4);
  transform: translateX(3px);
}

.cmd-preset-btn code {
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.cmd-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

/* ── Buttons & Forms ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #050811;
  font-weight: 700;
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* ── API Explorer ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.text-dim { color: var(--text-dim); font-size: 0.85rem; }
.text-accent { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-purple { color: var(--accent-purple); }
.text-cyan { color: var(--accent-cyan); }

.api-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.api-row {
  display: flex;
  gap: 0.75rem;
}

.select-method {
  background: #111624;
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: var(--font-code);
  outline: none;
}

.input-path {
  flex: 1;
  background: #111624;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  font-size: 0.9rem;
  outline: none;
}

.api-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
}

.input-field, .textarea-field {
  background: #111624;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.response-section {
  margin-top: 1.5rem;
  background: #090c14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #111624;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.response-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

.response-badge {
  font-size: 0.75rem;
  font-family: var(--font-code);
  color: var(--text-dim);
}

.response-body {
  padding: 1rem;
  max-height: 380px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #a5b4fc;
}

/* ── Mission & Attack Graph ────────────────────────────────────────── */
.mission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.mission-body p {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.section-heading {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stage-item {
  display: flex;
  gap: 0.9rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.stage-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.stage-info strong {
  font-size: 0.85rem;
  display: block;
}

.stage-info p {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.arch-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.account-card {
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
}

.root-acc {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(157, 78, 221, 0.08));
  border-color: rgba(239, 68, 68, 0.3);
}

.acc-arrow {
  text-align: center;
  font-size: 0.75rem;
  font-family: var(--font-code);
  color: var(--accent-cyan);
  padding: 0.2rem 0;
}

.acc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.infra-acc {
  background: rgba(79, 172, 254, 0.05);
  border-color: rgba(79, 172, 254, 0.2);
}

.sec-acc.current {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

.acc-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.active-badge {
  color: var(--accent-cyan);
}

.acc-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── System Status Table ───────────────────────────────────────────── */
.status-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.stat-name {
  color: var(--text-dim);
}

.stat-val {
  font-family: var(--font-code);
  font-weight: 600;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

.footer-sep {
  margin: 0 0.5rem;
}
