:root {
  --bg: #0f172a;
  --card: #111827;
  --card-soft: #0b1629;
  --muted: #9ca3af;
  --text: #e5e7eb;
  --primary: #22d3ee;
  --accent: #6366f1;
  --border: #1f2937;
  --line: #1e293b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #f87171;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.08), transparent 20%),
              radial-gradient(circle at 90% 20%, rgba(34, 211, 238, 0.08), transparent 23%),
              radial-gradient(circle at 50% 90%, rgba(34, 197, 94, 0.06), transparent 25%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.18), rgba(34, 211, 238, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 16px;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.25), transparent 45%),
              linear-gradient(140deg, #22d3ee, #6366f1);
  display: grid;
  place-items: center;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.35);
}

.brand-title { font-weight: 700; }
.brand-sub { color: var(--muted); font-size: 13px; }

.search-group {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 320px;
}

.search-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: #0f172a;
}

button:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(120deg, #22d3ee, #6366f1);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.35);
  color: #0b1020;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.layout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

.sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  position: sticky;
  top: 120px;
  max-height: calc(100vh - 160px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-title { font-weight: 700; }
.sidebar-sub { color: var(--muted); font-size: 13px; }

.pill {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  white-space: nowrap;
}

.tree {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-soft);
  padding: 10px;
  overflow: auto;
  max-height: 64vh;
}

.tree-item {
  margin-left: 6px;
  border-left: 1px dashed rgba(255, 255, 255, 0.07);
  padding-left: 8px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}

.tree-row:hover { background: rgba(255, 255, 255, 0.04); }

.tree-row.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.tree-label {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chevron {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.files {
  margin-left: 22px;
  display: grid;
  gap: 6px;
  padding: 6px 0 10px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.file-row:hover { background: rgba(255, 255, 255, 0.04); }
.file-row.active {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.4);
  color: #a5f3fc;
}

.main {
  display: grid;
  gap: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  min-height: 90px;
}

.card small { color: var(--muted); }
.card-value { font-size: 20px; font-weight: 700; }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-tag button {
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 16px;
  box-shadow: none;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: rgba(255, 255, 255, 0.03);
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

tbody tr.active {
  background: rgba(34, 211, 238, 0.1);
  border-left: 2px solid #22d3ee;
}

.level {
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.level.info { background: rgba(34, 211, 238, 0.14); color: #a5f3fc; }
.level.warn { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.level.error { background: rgba(248, 113, 113, 0.16); color: #fecdd3; }

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

.code {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
}

.code-line {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  border-radius: 8px;
}

.code-line mark {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
  padding: 0 2px;
  border-radius: 4px;
}

.line-no {
  width: 52px;
  text-align: right;
  color: var(--muted);
  flex-shrink: 0;
  opacity: 0.6;
}

.file-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
  animation: shimmer 1.4s infinite;
}

.skeleton-line {
  height: 16px;
  border-radius: 8px;
  margin: 6px 0;
}

@keyframes shimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: auto; max-height: none; }
  .topbar { flex-direction: column; align-items: stretch; }
  .search-row { grid-template-columns: 1fr; }
}

