:root {
  /* Linear-style pro SaaS theme — neutral dark + indigo accent */
  --bg: #08090c;
  --bg-2: #0d0e12;
  --panel: #111218;
  --panel-2: #181923;
  --border: #22242e;
  --border-2: #2d2f3b;
  --text: #f4f5f8;
  --text-dim: #9ca0ad;
  --text-muted: #6b6f7d;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --cyan: #818cf8;
  --cyan-glow: rgba(129, 140, 248, 0.3);
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.18);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(rgba(8, 9, 12, 0.55), rgba(8, 9, 12, 0.65)),
    url('/static/assets/bg-taika.jpg') center center / cover no-repeat fixed,
    var(--bg);
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.1), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(139, 92, 246, 0.08), transparent 55%);
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* Make panels slightly translucent so the cat shows through everywhere */
.card, .stat, .section, .step, .sidebar, .modal, .live-panel {
  background: rgba(17, 18, 24, 0.82) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.main {
  background: transparent;
}

/* Logo brand image styling */
.brand-logo {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; object-position: center;
  border: 2px solid var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
  flex-shrink: 0;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--cyan); }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

input, select, textarea {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius);
  width: 100%;
  outline: none;
  transition: all 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: var(--text-muted); }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { background: #5558e8; box-shadow: 0 4px 14px var(--accent-glow); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.cyan { background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); }
.btn.cyan:hover { background: var(--panel); border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text);
}
.btn.ghost:hover { background: var(--panel-2); border-color: var(--accent); }
.btn.danger { background: linear-gradient(135deg, var(--danger), #b91c1c); }
.btn.success { background: linear-gradient(135deg, var(--success), #15803d); }
.btn.sm { padding: 6px 12px; font-size: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
  height: 2px;
  top: 0;
  bottom: auto;
}
.stat .label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.stat .val { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tr:hover td { background: rgba(99, 102, 241, 0.04); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--border);
}
.badge.green { background: rgba(34,197,94,0.12); color: var(--success); }
.badge.red { background: rgba(239,68,68,0.12); color: var(--danger); }
.badge.yellow { background: rgba(245,158,11,0.12); color: var(--warn); }
.badge.cyan { background: rgba(129,140,248,0.15); color: var(--cyan); }
.badge.purple { background: rgba(99,102,241,0.15); color: var(--accent); }

/* Layout */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  z-index: 10;
}
.sidebar .brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.sidebar .nav { margin-top: 16px; }
.sidebar .nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px;
  color: var(--text-dim);
  border-left: 3px solid transparent;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar .nav a:hover { background: var(--panel); color: var(--text); }
.sidebar .nav a.active {
  background: var(--panel-2);
  color: var(--text);
  border-left-color: var(--accent);
}

.main {
  margin-left: 240px;
  padding: 24px 32px;
  min-height: 100vh;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 22px; font-weight: 700; }
.topbar .user {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-dim);
}
.topbar .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff; font-size: 13px;
}

/* Mission steps */
.step {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  position: relative;
}
.step .step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step .num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--border); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.step.done .num { background: var(--success); }
.step.active .num { background: linear-gradient(135deg, var(--accent), var(--cyan)); box-shadow: 0 0 20px var(--accent-glow); }
.step h3 { font-size: 14px; font-weight: 600; }
.step .step-body { padding-left: 44px; }

/* Console */
.console {
  background: #05070b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 12px;
  height: 320px;
  overflow-y: auto;
  color: #a5d6ff;
}
.console .line { padding: 2px 0; white-space: pre-wrap; }
.console .line .t { color: var(--text-muted); margin-right: 8px; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 92%; max-width: 480px;
  box-shadow: var(--shadow-glow);
}
.modal h2 { font-size: 18px; margin-bottom: 18px; }
.modal .row { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  min-width: 260px;
  animation: slide 0.25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slide { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Utils */
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.mt-10 { margin-top: 10px; } .mt-20 { margin-top: 20px; } .mb-20 { margin-bottom: 20px; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.flex-1 { flex: 1; }

/* Scroll */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
