/* ============================================
   AdCraft Admin - 共通スタイル
   3つの管理画面（client / internal / creator）共通
   トーン: LP（白×オレンジ）と統一
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=Zen+Kaku+Gothic+New:wght@400;500;700;900&family=RocknRoll+One&display=swap');

:root {
  --bg-canvas: #F7F4ED;
  --bg: #FFFFFF;
  --bg-soft: #FFF9F2;
  --ink: #1A1A1E;
  --ink-2: #4A4A52;
  --ink-3: #7A7A82;
  --ink-4: #B0B0B8;

  --orange: #FF8A33;
  --orange-deep: #F56A0F;
  --orange-soft: #FFB97A;
  --orange-pale: #FFE5CE;
  --orange-ultralight: #FFF3E6;

  --cyan: #5EC7E0;
  --cyan-soft: #B8E6F0;

  --success: #20C997;
  --warning: #F5A300;
  --danger: #E6597D;

  --line: #EEEAE2;
  --line-soft: #F4F0E6;
  --white: #FFFFFF;

  --shadow-sm: 0 2px 6px rgba(26,26,30,.04);
  --shadow-md: 0 4px 12px rgba(26,26,30,.06);
  --shadow-lg: 0 12px 28px rgba(26,26,30,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg-canvas);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "palt";
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* ============================================
   レイアウト
   ============================================ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ============================================
   サイドバー
   ============================================ */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-header {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.sidebar-logo-mark {
  color: var(--orange-deep);
  font-size: 18px;
}
.sidebar-role {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange-deep);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--orange-ultralight);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
}
.sidebar-role.role-internal {
  color: var(--ink);
  background: var(--line-soft);
}
.sidebar-role.role-creator {
  color: #0B5B6F;
  background: var(--cyan-soft);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}
.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  padding: 10px 12px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.nav-item.active {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245,106,15,.25);
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

/* SVGアイコン共通 */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
}
.icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}
.icon-sm svg { width: 14px; height: 14px; }
.icon-lg svg { width: 22px; height: 22px; }

/* プロジェクトサムネを文字ベースに */
.thumb-letter {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "RocknRoll One", sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.thumb-letter.tone-orange { background: var(--orange-ultralight); color: var(--orange-deep); }
.thumb-letter.tone-cyan   { background: var(--cyan-soft); color: #0B5B6F; }
.thumb-letter.tone-green  { background: rgba(32,201,151,.15); color: var(--success); }
.thumb-letter.tone-pink   { background: rgba(230,89,125,.15); color: var(--danger); }
.thumb-letter.tone-yellow { background: rgba(245,163,0,.15); color: var(--warning); }
.thumb-letter.tone-neutral{ background: var(--line-soft); color: var(--ink-2); }

/* ============================================
   クリーン版（散らかり感を抑えた整理スタイル）
   ============================================ */

/* KPIカード：アイコンチップ無し版 */
.kpi-grid.clean .kpi-card {
  padding: 22px 22px 18px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: none;
  transition: border-color .15s, transform .15s;
}
.kpi-grid.clean .kpi-card:hover {
  border-color: var(--orange-soft);
  transform: none;
}
.kpi-label-clean {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.kpi-grid.clean .kpi-trend {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}
.kpi-grid.clean .kpi-trend.up    { color: var(--success); }
.kpi-grid.clean .kpi-trend.down  { color: var(--danger); }

/* オンボーディング：白＋細いオレンジアクセント */
.onboarding.clean {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  border-radius: 12px;
  padding: 20px 24px 22px;
  margin-bottom: 22px;
  box-shadow: none;
  position: relative;
}
.onboarding.clean::before { content: none; }
.onboarding.clean .onboarding-head {
  margin-bottom: 14px;
}
.onboarding-icon-clean {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--orange-ultralight);
  color: var(--orange-deep);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.onboarding.clean .onboarding-title {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.onboarding.clean .onboarding-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 2px;
}
.onboarding.clean .onboarding-progress-num {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 700;
}
.onboarding.clean .onboarding-progress-bar {
  background: var(--line-soft);
}
.onboarding.clean .onboarding-step {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 12px 14px;
}
.onboarding.clean .onboarding-step.done {
  background: transparent;
}
.onboarding.clean .onboarding-step.active {
  background: var(--orange-ultralight);
  border: none;
  box-shadow: none;
}
.onboarding.clean .onboarding-step-mark {
  width: 24px; height: 24px;
  font-size: 12px;
}
.onboarding.clean .onboarding-close {
  background: transparent;
  font-size: 18px;
  color: var(--ink-3);
}

/* アラート：控えめ版 */
.alert.clean {
  background: #FFF8E8;
  border: 1px solid #F0D88A;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 22px;
}
.alert-icon-clean {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--warning);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.alert.clean strong {
  color: var(--orange-deep);
  font-weight: 800;
}

/* パネル：ヘッダーのアイコンチップを控えめに */
.panel-title-icon { display: none; }

/* バッジ：色数を抑える（基本は使うが、ややトーンダウン） */
.badge { font-weight: 600; padding: 3px 10px; }

/* ============================================
   モバイル対応（ハンバーガーメニュー・レスポンシブ）
   ============================================ */
.menu-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle:hover { border-color: var(--orange); color: var(--orange-deep); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,26,30,.45);
  z-index: 99;
  opacity: 0;
  transition: opacity .25s;
}
body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
}

@media (max-width: 800px) {
  /* gridを完全に解除してサイドバーぶんの空きをなくす */
  .app {
    display: block;
  }
  .menu-toggle { display: inline-flex; }

  /* サイドバーは普段は非表示、開いた時だけfixedで出す */
  .sidebar {
    display: none;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 24px rgba(26,26,30,.18);
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .25s ease-out;
    overflow-y: auto;
  }
  body.sidebar-open .sidebar {
    display: flex;
    transform: translateX(0);
  }
  .sidebar-header { padding: 18px 18px 14px; }
  .sidebar-nav { padding: 14px 12px; flex-direction: column; overflow-y: auto; }
  .nav-section-label { display: block; }

  /* main 全体を画面いっぱいに */
  .main {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* トップバー */
  .topbar {
    padding: 12px 16px;
    gap: 10px;
  }
  .topbar-title { font-size: 17px; }
  .topbar-search { display: none; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn { padding: 7px 12px; font-size: 12px; }

  /* メイン */
  .content {
    padding: 18px 16px 60px;
  }
  .content-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .content-header h1 { font-size: 19px; }
  .content-header p { font-size: 12px; }

  /* KPI 4列 → 2列 */
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .kpi-grid .kpi-card { padding: 16px 16px 14px; }
  .kpi-value { font-size: 24px; }
  .kpi-unit { font-size: 12px; }

  /* グリッドレイアウト：縦積み */
  .grid-2, .grid-2-eq { grid-template-columns: 1fr; gap: 14px; }

  /* タブ・フィルタ */
  .tabs { overflow-x: auto; padding: 0 4px; flex-wrap: nowrap; }
  .tab-item { padding: 9px 14px; white-space: nowrap; font-size: 12.5px; }
  .filter-bar { gap: 8px; flex-wrap: wrap; }
  .filter-bar > * { font-size: 12px; }

  /* テーブル：横スクロール */
  .panel { overflow-x: auto; }
  .data-table { min-width: 640px; font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 12px; }

  /* フォーム */
  .form-grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .form-section { padding: 18px 18px; }
  .form-section-title { font-size: 14px; }

  /* オンボーディング */
  .onboarding { padding: 16px 18px 18px; }
  .onboarding-head { flex-wrap: wrap; gap: 10px; }
  .onboarding-progress { width: 100%; text-align: left; }
  .onboarding-progress-bar { width: 100%; }
  .onboarding-step {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }
  .onboarding-step-info { flex-basis: calc(100% - 40px); }
  .onboarding-step .btn { width: 100%; justify-content: center; }

  /* チャット：スマホでは1ペイン式 */
  .chat-app {
    grid-template-columns: 1fr !important;
    height: calc(100vh - 56px);
  }
  .chat-sidebar { display: var(--chat-pane-list, flex); }
  .chat-main { display: var(--chat-pane-main, none); }
  body.chat-detail .chat-sidebar { display: none; }
  body.chat-detail .chat-main { display: flex; }
  .chat-back-btn { display: inline-flex !important; }

  /* タイムラインコメント */
  .timeline-wrap { padding: 14px 16px 16px; }
  .timeline-bar { height: 32px; }
  .timeline-pin { width: 14px; height: 44px; }

  /* ミッション */
  .mission-card { flex-wrap: wrap; gap: 10px; }
  .mission-info { flex-basis: calc(100% - 50px); }
  .mission-reward { flex-basis: 100%; text-align: right; }

  /* ランクメーター */
  .gauge-row { flex-wrap: wrap; gap: 8px; }
  .gauge-label { flex: 1 0 60%; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar-title { font-size: 16px; }
  .content { padding: 16px 14px 50px; }
  .form-section { padding: 16px 14px; }
  .form-input, .form-select, .form-textarea { font-size: 16px; }  /* iOS ズーム抑制 */
  .panel-header { padding: 14px 16px 12px; }
  .panel-body { padding: 6px 16px 16px; }
  .panel-title { font-size: 14px; }
  .data-table th, .data-table td { padding: 10px 12px; font-size: 11.5px; }
  .video-uploader { padding: 24px 16px; }
  .video-uploader-icon { width: 48px; height: 48px; }
}

/* iPhone SE / 小型スマホ */
@media (max-width: 380px) {
  .topbar { padding: 8px 12px; gap: 6px; }
  .topbar-title { font-size: 15px; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 11.5px; }
  .menu-toggle { width: 34px; height: 34px; }
  .menu-toggle svg { width: 18px; height: 18px; }
  .content { padding: 14px 12px 40px; }
  .content-header h1 { font-size: 17px; }
  .kpi-card { padding: 14px 14px 12px; }
  .kpi-value { font-size: 22px; }
  .kpi-label-clean { font-size: 11px; margin-bottom: 6px; }
  .form-section { padding: 14px 14px; }
  .onboarding { padding: 14px 14px 16px; }
  .onboarding-icon-clean { width: 32px; height: 32px; }
  .onboarding-title { font-size: 14px; }
  .alert.clean { padding: 10px 12px; font-size: 12px; }
  .video-uploader { padding: 22px 14px; }
  .video-uploader-title { font-size: 13px; }
  .video-uploader-help { font-size: 11px; }
}

/* チャット用：モバイル時の戻るボタン */
.chat-back-btn {
  display: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 4px;
}
.chat-back-btn svg { width: 16px; height: 16px; }

/* ============================================
   動画アップローダー（クリエイター用）
   ============================================ */
.video-uploader {
  display: block;
  border: 2px dashed var(--orange-soft);
  border-radius: 16px;
  padding: 32px 22px;
  text-align: center;
  background: var(--orange-ultralight);
  position: relative;
  transition: border-color .15s, background .15s;
  cursor: pointer;
  margin-bottom: 18px;
}
.video-uploader:hover,
.video-uploader.dragover {
  border-color: var(--orange);
  background: #FFF3E6;
}
.video-uploader-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--white);
  color: var(--orange-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(245,106,15,.18);
}
.video-uploader-icon svg { width: 26px; height: 26px; }
.video-uploader-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}
.video-uploader-help {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
}
.video-uploader-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.video-uploader input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-progress {
  display: none;
  margin-top: 12px;
}
.upload-progress.active { display: block; }
.upload-progress-bar {
  height: 8px;
  background: var(--line-soft);
  border-radius: 4px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-deep) 100%);
  border-radius: 4px;
  transition: width .3s;
}
.upload-progress-text {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 6px;
  font-weight: 700;
}

/* ============================================
   ミッション・ランク維持メーター（クリエイター）
   ============================================ */
.mission-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  margin-bottom: 10px;
  transition: border-color .15s, transform .15s;
}
.mission-card:hover { border-color: var(--orange-soft); transform: translateY(-1px); }
.mission-card:last-child { margin-bottom: 0; }
.mission-card.done { background: var(--bg-soft); opacity: 0.7; border-color: transparent; }
.mission-card.almost { border-color: var(--orange); border-left: 3px solid var(--orange); }
.mission-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--orange-ultralight);
  color: var(--orange-deep);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mission-icon svg { width: 16px; height: 16px; }
.mission-card.done .mission-icon { background: rgba(32,201,151,.15); color: var(--success); }
.mission-info {
  flex: 1;
  min-width: 0;
}
.mission-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mission-desc {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.mission-bar {
  height: 5px;
  background: var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}
.mission-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange-soft) 0%, var(--orange-deep) 100%);
  border-radius: 3px;
}
.mission-card.done .mission-fill { background: var(--success); }
.mission-reward {
  font-family: "RocknRoll One", sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: var(--orange-deep);
  flex-shrink: 0;
}
.mission-card.done .mission-reward { color: var(--success); }

/* ランク維持メーター */
.gauge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.gauge-row:last-child { border-bottom: none; }
.gauge-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gauge-status.safe   { background: var(--success); box-shadow: 0 0 0 3px rgba(32,201,151,.18); }
.gauge-status.warn   { background: var(--warning); box-shadow: 0 0 0 3px rgba(245,163,0,.18); }
.gauge-status.danger { background: var(--danger);  box-shadow: 0 0 0 3px rgba(230,89,125,.18); }
.gauge-label {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.gauge-value {
  font-family: "RocknRoll One", sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
}
.gauge-target {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  margin-left: 4px;
}
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.2;
}
.nav-item.active .nav-badge {
  background: var(--white);
  color: var(--orange-deep);
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-soft) 0%, var(--orange) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-user {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-meta {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   メインエリア
   ============================================ */
.main {
  padding: 0;
  min-width: 0;
}

/* トップバー */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.topbar-search {
  margin-left: 24px;
  position: relative;
  flex: 1;
  max-width: 380px;
}
.topbar-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
}
.topbar-search input:focus {
  border-color: var(--orange);
  background: var(--white);
}
.topbar-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  position: relative;
  transition: background .15s;
}
.topbar-icon-btn:hover {
  background: var(--bg-soft);
}
.topbar-icon-btn .badge-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--white);
}

/* メインコンテンツ */
.content {
  padding: 28px 32px 60px;
  max-width: 1400px;
}
.content-header {
  margin-bottom: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.content-header-text h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.content-header-text p {
  font-size: 13px;
  color: var(--ink-3);
}

/* ============================================
   KPIカード
   ============================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi-label {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-label-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--orange-ultralight);
  color: var(--orange-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.kpi-card.kpi-cyan .kpi-label-icon {
  background: var(--cyan-soft);
  color: #0B5B6F;
}
.kpi-card.kpi-success .kpi-label-icon {
  background: rgba(32,201,151,.15);
  color: var(--success);
}
.kpi-card.kpi-warning .kpi-label-icon {
  background: rgba(245,163,0,.15);
  color: var(--warning);
}
.kpi-value {
  font-family: "RocknRoll One", "Zen Kaku Gothic New", sans-serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}
.kpi-unit {
  font-size: 14px;
  color: var(--ink-3);
  margin-left: 4px;
  font-weight: 700;
  letter-spacing: 0;
}
.kpi-trend {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.flat { color: var(--ink-3); }

/* ============================================
   セクションカード（リスト・テーブル等の共通箱）
   ============================================ */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.panel-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--orange-ultralight);
  color: var(--orange-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.panel-link {
  font-size: 12px;
  color: var(--orange-deep);
  font-weight: 700;
}
.panel-link:hover {
  text-decoration: underline;
}
.panel-body {
  padding: 8px 22px 18px;
}

/* グリッドレイアウト */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}
.grid-2-eq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ============================================
   案件カード（dashboard 用 リストアイテム）
   ============================================ */
.project-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 14px;
}
.project-row:last-child { border-bottom: none; }
.project-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--orange-pale) 0%, var(--orange-ultralight) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.project-info {
  flex: 1;
  min-width: 0;
}
.project-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.project-progress {
  flex: 0 0 130px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-progress-bar {
  height: 6px;
  background: var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
}
.project-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange-soft) 0%, var(--orange-deep) 100%);
  border-radius: 3px;
}
.project-progress-text {
  font-size: 11px;
  color: var(--ink-3);
  text-align: right;
  font-weight: 700;
}

/* バッジ（ステータス） */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-success { background: rgba(32,201,151,.15); color: var(--success); }
.badge-warning { background: rgba(245,163,0,.15); color: var(--warning); }
.badge-danger { background: rgba(230,89,125,.15); color: var(--danger); }
.badge-orange { background: var(--orange-ultralight); color: var(--orange-deep); }
.badge-cyan { background: var(--cyan-soft); color: #0B5B6F; }
.badge-neutral { background: var(--line-soft); color: var(--ink-2); }

/* ============================================
   ボタン
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .15s;
  border: 1.5px solid transparent;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245,106,15,.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(245,106,15,.35);
}
.btn-ghost {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--orange);
  color: var(--orange-deep);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ============================================
   ピル / アラート
   ============================================ */
.alert {
  background: linear-gradient(180deg, #FFF8E8 0%, #FFF0CC 100%);
  border: 1.5px solid #F5C75A;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--warning);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}
.alert-strong {
  color: var(--orange-deep);
  font-weight: 900;
}

/* ============================================
   オンボーディング（スタートガイド）
   ============================================ */
.onboarding {
  background: linear-gradient(135deg, #FFF8F0 0%, #FFE5CE 60%, #FFD4A6 100%);
  border: 1.5px solid var(--orange-soft);
  border-radius: 18px;
  padding: 22px 26px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(245,106,15,.12);
}
.onboarding::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,.5) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.onboarding-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  position: relative;
}
.onboarding-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(245,106,15,.3);
}
.onboarding-title {
  font-family: "RocknRoll One", "Zen Kaku Gothic New", sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.onboarding-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
  margin-top: 2px;
}
.onboarding-progress {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}
.onboarding-progress-num {
  font-family: "RocknRoll One", sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: var(--orange-deep);
  line-height: 1;
}
.onboarding-progress-bar {
  width: 110px;
  height: 6px;
  background: rgba(255,255,255,.65);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-deep) 100%);
  border-radius: 3px;
  transition: width .3s;
}
.onboarding-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  z-index: 2;
  transition: background .15s;
}
.onboarding-close:hover {
  background: rgba(255,255,255,1);
  color: var(--ink);
}

.onboarding-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,.7);
  border-radius: 12px;
  transition: background .15s, transform .15s;
}
.onboarding-step.done {
  opacity: 0.55;
  background: rgba(255,255,255,.4);
}
.onboarding-step.active {
  background: var(--white);
  border: 1.5px solid var(--orange);
  box-shadow: 0 4px 12px rgba(245,106,15,.18);
}
.onboarding-step-mark {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-3);
  font-weight: 900;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid var(--line);
}
.onboarding-step.done .onboarding-step-mark {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}
.onboarding-step.active .onboarding-step-mark {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: var(--white);
  border-color: var(--orange-deep);
}
.onboarding-step-info { flex: 1; min-width: 0; }
.onboarding-step-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
}
.onboarding-step.done .onboarding-step-title {
  text-decoration: line-through;
  color: var(--ink-3);
}
.onboarding-step-desc {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.6;
}
.onboarding-step .btn {
  flex-shrink: 0;
}

/* ============================================
   タブ
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding: 0 4px;
}
.tab-item {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-item:hover {
  color: var(--ink);
}
.tab-item.active {
  color: var(--orange-deep);
  border-bottom-color: var(--orange-deep);
}
.tab-count {
  background: var(--line-soft);
  color: var(--ink-3);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.tab-item.active .tab-count {
  background: var(--orange-ultralight);
  color: var(--orange-deep);
}

/* ============================================
   フィルターバー
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.filter-input:focus { border-color: var(--orange); }
.filter-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 32px 8px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%237A7A82' stroke-width='1.5' fill='none'/></svg>") no-repeat right 12px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--orange); }

/* ============================================
   データテーブル
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table th:first-child { padding-left: 22px; }
.data-table th:last-child { padding-right: 22px; }
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  vertical-align: middle;
}
.data-table td:first-child { padding-left: 22px; }
.data-table td:last-child { padding-right: 22px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--bg-soft); }
.data-table tr { transition: background .15s; }
.data-table .td-strong { font-weight: 700; color: var(--ink); }
.data-table .td-mute { color: var(--ink-3); font-size: 12px; }
.data-table .td-money { font-family: "RocknRoll One", sans-serif; font-weight: 900; }

/* ============================================
   フォーム
   ============================================ */
.form-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 18px;
}
.form-section-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.form-section-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.form-section-desc {
  font-size: 12px;
  color: var(--ink-3);
}
.form-row {
  margin-bottom: 18px;
}
.form-row:last-child { margin-bottom: 0; }
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.form-label .required {
  color: var(--danger);
  margin-left: 4px;
}
.form-help {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 6px;
  line-height: 1.6;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--orange);
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}
.form-select {
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%237A7A82' stroke-width='1.5' fill='none'/></svg>") no-repeat right 14px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
}
.form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.form-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
  background: var(--white);
  user-select: none;
}
.form-check:hover {
  border-color: var(--orange-soft);
  color: var(--orange-deep);
}
.form-check input {
  display: none;
}
.form-check input:checked + span {
  color: var(--orange-deep);
}
.form-check.checked,
.form-check input:checked ~ * {
  /* helper for non-input variant */
}
.form-check[data-checked="true"] {
  border-color: var(--orange);
  background: var(--orange-ultralight);
  color: var(--orange-deep);
  box-shadow: 0 4px 10px rgba(245,106,15,.12);
}
.form-check.with-icon::before {
  content: "";
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--ink-3);
  display: inline-block;
  flex-shrink: 0;
}
.form-check[data-checked="true"].with-icon::before {
  background: var(--orange-deep) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M1.5 5l2.5 2.5L8.5 2.5' stroke='white' stroke-width='1.8' fill='none'/></svg>") center center no-repeat;
  border-color: var(--orange-deep);
}

/* アップロードエリア */
.upload-area {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  background: var(--bg-soft);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.upload-area:hover {
  border-color: var(--orange);
  background: var(--orange-ultralight);
}
.upload-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.upload-text { font-size: 13px; font-weight: 700; color: var(--ink); }
.upload-help { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* ステップインジケーター */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 22px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 700;
}
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}
.step-item.active .step-num {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(245,106,15,.3);
}
.step-item.done .step-num {
  background: var(--success);
  color: var(--white);
}
.step-item.active { color: var(--ink); }
.step-divider {
  flex: 1;
  height: 2px;
  background: var(--line);
  margin: 0 12px;
  border-radius: 1px;
}
.step-divider.done { background: var(--success); }

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    width: 100%;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-header, .sidebar-footer { padding: 12px 16px; }
  .sidebar-nav { display: flex; gap: 6px; overflow-x: auto; padding: 12px; }
  .nav-section-label { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 40px; }
}
