/* ==========================================================================
   QueTogether — Layout: marketing-topbar + app-shell (sidebar/topbar)
   ========================================================================== */

/* ============ Logotyp ============ */
.logo {
  display: inline-flex;
  flex-direction: column;
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: -0.02em;
  user-select: none;
}
.logo .logo-que { font-size: 1.5rem; color: var(--text); }
.logo .logo-together {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-sm .logo-que { font-size: 1.15rem; }
.logo-sm .logo-together { font-size: 0.58rem; }

/* ============ Marketing-topbar (landningssidor) ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 10, 15, 0.72);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--sp-5);
}
.site-nav {
  display: flex;
  gap: var(--sp-6);
  list-style: none;
}
.site-nav a {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 6px 0;
  position: relative;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.is-active { color: var(--text); }
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
}
.header-actions { display: flex; align-items: center; gap: var(--sp-3); }

.nav-toggle { display: none; }
@media (max-width: 900px) {
  .site-nav, .header-actions .btn-ghost:not(.nav-toggle) { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ============ App-shell (inloggat läge) ============ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* --- Sidomeny --- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-4);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.sidebar-brand { padding: 0 10px var(--sp-2); }
.sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav .nav-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: var(--sp-4) 12px 6px;
  font-weight: 700;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.94rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-nav a:hover { background: var(--surface); color: var(--text); }
.sidebar-nav a.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}
.sidebar-nav a .count {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-full);
}
.sidebar-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.sidebar-user .meta { overflow: hidden; }
.sidebar-user .meta strong { display: block; font-size: 0.9rem; }
.sidebar-user .meta span { font-size: 0.78rem; color: var(--online); }

/* --- App-topbar --- */
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.app-topbar .search {
  flex: 1;
  max-width: 460px;
}
.app-topbar .spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: var(--r-full);
  border: 2px solid var(--surface);
}

.app-content { padding: var(--sp-6); max-width: 1500px; width: 100%; }
.page-title { margin-bottom: var(--sp-2); }
.page-lead { color: var(--text-muted); margin-bottom: var(--sp-6); max-width: 640px; }

/* --- Mobil sidomeny --- */
.sidebar-backdrop { display: none; }
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 270px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 150;
  }
  .app-menu-btn { display: inline-flex !important; }
}
.app-menu-btn { display: none; }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: var(--sp-7) 0 var(--sp-5);
  margin-top: var(--sp-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.footer-grid h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-grid ul a { color: var(--text-muted); font-size: 0.9rem; }
.footer-grid ul a:hover { color: var(--primary); }
.footer-about p { color: var(--text-muted); font-size: 0.9rem; margin: var(--sp-3) 0; max-width: 320px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: var(--sp-4);
  color: var(--text-dim);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted);
}
.footer-social a:hover { color: var(--primary); border-color: var(--primary); }
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
