/* ─── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #0F172A;
  color: #F1F5F9;
  font-family: 'JetBrains Mono', 'Fira Mono', 'Cascadia Code', monospace;
  font-size: 13px;
  display: flex;
  flex-direction: row;
}

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #0B1120;
  border-right: 1px solid #1E293B;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.22s ease;
}

.sidebar.collapsed {
  width: 44px;
  overflow-y: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #1E293B; border-radius: 2px; }

/* Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid #1E293B;
  flex-shrink: 0;
  min-width: 220px;
}

.sidebar-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #CBD5E1;
  flex: 1;
  white-space: nowrap;
}

/* Toggle button */
.sidebar-toggle {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 5px;
  color: #475569;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
}

.sidebar-toggle:hover {
  background: #1E293B;
  color: #94A3B8;
  border-color: #475569;
}

/* In collapsed state, re-anchor header so toggle button is visible and centered */
.sidebar.collapsed .sidebar-header {
  min-width: 0;
  padding: 18px 11px 16px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-icon,
.sidebar.collapsed .sidebar-title {
  display: none;
}

/* Nav sections */
.nav-section {
  padding: 16px 0 8px;
}

.nav-section + .nav-section {
  border-top: 1px solid #1E293B;
}

.nav-section-label {
  padding: 0 16px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #334155;
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #64748B;
  text-decoration: none;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background: #111827;
  color: #94A3B8;
  border-left-color: #334155;
}

.nav-item.active {
  background: #0F1F38;
  color: #F1F5F9;
  border-left-color: #3B82F6;
}

.nav-item-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* Hide nav content when collapsed */
.sidebar.collapsed .nav-section,
.sidebar.collapsed .sidebar-footer {
  display: none;
}

/* Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid #1E293B;
  flex-shrink: 0;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  text-decoration: none;
  font-size: 11px;
  transition: color 0.15s;
}

.sidebar-footer-link:hover { color: #64748B; }

.gh-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ─── Main content ──────────────────────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  position: relative;
  display: flex;
}

iframe#contentFrame {
  display: none;
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
}

/* ─── Welcome screen ────────────────────────────────────────────── */
.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 32px;
  text-align: center;
}

.welcome-icon {
  font-size: 48px;
  line-height: 1;
}

.welcome-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #CBD5E1;
}

.welcome-sub {
  font-size: 13px;
  color: #475569;
  max-width: 340px;
  line-height: 1.7;
}

.welcome-cards {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.welcome-card {
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 20px 24px;
  width: 180px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.welcome-card-icon {
  font-size: 24px;
  line-height: 1;
}

.welcome-card-label {
  font-size: 12px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.04em;
}

.welcome-card-desc {
  font-size: 11px;
  color: #475569;
  line-height: 1.6;
}

.welcome-hint {
  font-size: 11px;
  color: #334155;
  margin-top: 8px;
}
