/* リセット＋アプリシェル（ヘッダー・サイドバー・メインレイアウト） */
* { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    font-family: "Inter", "Hiragino Sans", "Noto Sans CJK JP", "Meiryo", ui-sans-serif, system-ui, sans-serif;
    background: var(--background);
    color: var(--foreground);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
  }
  svg { flex-shrink: 0; }
  button { font-family: inherit; cursor: pointer; }

  .app { height: 100vh; display: flex; flex-direction: column; }

  /* ===== ヘッダー ===== */
  .topbar {
    height: 48px; flex-shrink: 0; background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; z-index: 10;
  }
  .topbar-left { display: flex; align-items: center; gap: 8px; font-size: 14px; }
  .logo { display: flex; align-items: center; }
    .crumb-sep { color: var(--border); padding: 0 4px; }
  .crumb { display: flex; align-items: center; gap: 8px; color: var(--foreground); }
  .crumb .icon { color: var(--muted-foreground); }
  .badge-plan {
    display: inline-flex; align-items: center; border-radius: 9999px;
    background: var(--primary); color: var(--primary-foreground);
    font-size: 10px; font-weight: 500; padding: 1px 6px; white-space: nowrap;
  }
  .chevrons { color: var(--muted-foreground); display: inline-flex; padding: 4px; border-radius: 6px; background: transparent; border: none; }
  .chevrons:hover { background: var(--muted); }
  .topbar-right { display: flex; align-items: center; gap: 6px; }
  .coins { display: flex; align-items: center; gap: 6px; color: var(--amber-500); font-size: 14px; padding: 4px 8px; }
  .search-btn {
    height: 30px; width: 140px; border-radius: 6px; padding: 0 4px 0 8px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    border: 1px solid var(--border); background: rgba(243,244,246,0.5);
    color: var(--muted-foreground); font-size: 12px;
  }
  .kbd { display: flex; align-items: center; gap: 2px; height: 20px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--border); background: var(--muted); font-size: 11px; }
  .icon-btn { position: relative; width: 32px; height: 32px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); background: transparent; border: none; }
  .icon-btn:hover { color: var(--foreground); background: var(--muted); }
  .notif-dot {
    position: absolute; top: 0; right: 0; height: 16px; min-width: 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9999px; background: var(--destructive); color: #fff;
    font-size: 10px; font-weight: 600; padding: 0 4px; box-shadow: 0 0 0 2px var(--card);
  }

  .body-row { flex: 1; display: flex; min-height: 0; }

  /* ===== サイドバー ===== */
  .sidebar {
    width: 260px; flex-shrink: 0; background: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex; flex-direction: column;
  }
  .sidebar nav { padding: 16px 8px 0; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
  .nav-label { height: 24px; display: flex; align-items: center; padding: 0 12px; font-size: 11px; font-weight: 600; color: rgba(113,113,122,0.6); letter-spacing: 0.06em; }
  .nav-group { display: flex; flex-direction: column; gap: 2px; }
  .nav-item {
    display: flex; align-items: center; gap: 12px; height: 32px;
    padding: 0 12px 0 10px; border-radius: 6px; font-size: 14px;
    color: rgba(17,24,39,0.7); background: transparent; border: none; width: 100%; text-align: left;
    transition: background 0.15s, color 0.15s; white-space: nowrap; overflow: hidden;
  }
  .nav-item:hover { background: rgba(243,244,246,0.5); color: var(--foreground); }
  .nav-item.active { background: var(--sidebar-accent); color: var(--foreground); font-weight: 500; }
  .nav-item:disabled { color: rgba(17,24,39,0.3); cursor: not-allowed; }
  .nav-item:disabled:hover { background: transparent; }
  .sidebar-footer { margin-top: auto; padding: 8px; border-top: 0; }
  .user-row { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 8px; width: 100%; background: transparent; border: none; text-align: left; }
  .user-row:hover { background: var(--sidebar-accent); }
  .avatar { width: 28px; height: 28px; border-radius: 9999px; background: var(--muted); color: var(--muted-foreground); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .user-name { font-size: 14px; font-weight: 500; }
  .user-mail { font-size: 12px; color: var(--muted-foreground); }

  /* ===== メイン ===== */
  .main { flex: 1; min-width: 0; overflow-y: auto; }
  .container { max-width: 1024px; margin: 0 auto; padding: 32px 24px 48px; }

  .page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
  .page-head p { margin-top: 4px; font-size: 14px; color: var(--muted-foreground); }
