/* ============================================================
   layout.css — Sidebar, Main, grid system, responsive
   ============================================================ */

.app { min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.25s ease, background 0.25s;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}
.logo-mark {
  width: 30px; height: 30px;
  border: 1.5px solid var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 15px; height: 15px; }
.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.logo-text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.logo-by {
  font-family: var(--mono);
  font-size: 9px;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0.7;
}

/* ---- NAV ---- */
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: none;
  border-radius: 9px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; }
.nav-item:hover { background: var(--accent-dim2); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 6px;
}

/* ---- THEME PICKER ---- */
.theme-picker {
  margin-top: auto;
  padding: 1rem 0.5rem 0.25rem;
  border-top: 1px solid var(--border);
}
.theme-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}
.theme-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 7px 9px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.theme-btn:hover { border-color: var(--border-active); color: var(--text); }
.theme-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim2); }
.theme-btn .sw {
  width: 13px; height: 13px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(127,127,127,0.35);
}
.theme-btn[data-theme="contrast"]  .sw { background: linear-gradient(135deg, #000 50%, #ffd400 50%); }
.theme-btn[data-theme="light"]     .sw { background: linear-gradient(135deg, #f5f6f8 50%, #4338ca 50%); }
.theme-btn[data-theme="dark"]      .sw { background: linear-gradient(135deg, #181b25 50%, #818cf8 50%); }
.theme-btn[data-theme="solarized"] .sw { background: linear-gradient(135deg, #fdf6e3 50%, #268bd2 50%); }

/* ---- MAIN ---- */
.main {
  margin-left: 260px;
  min-height: 100vh;
  padding: 2rem 2.5rem 5rem;
}
.main-inner {
  width: 100%;
  animation: fadeUp 0.4s ease both;
}
/* Per-view width: narrow forms vs. wide editors */
.main-inner.view-narrow { max-width: 900px; margin: 0 auto; }
.main-inner.view-wide   { max-width: 1400px; margin: 0 auto; }

/* ---- VIEW HEADER ---- */
.view-header { margin-bottom: 2rem; }
.view-title {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 5px;
}
.view-title span { color: var(--accent); }
.view-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---- HAMBURGER (mobile) ---- */
.hamburger {
  display: none;
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 60;
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.hamburger svg { width: 18px; height: 18px; stroke: currentColor; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,0.4); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 4.5rem 1.25rem 5rem; }
  .hamburger { display: flex; }
}
