/* =============================================
   203 Cash — 共通スタイルシート
   ============================================= */

/* ===== リセット & デザイントークン ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 背景・サーフェス */
  --bg:         #f0f2f5;
  --surface:    #ffffff;
  --sur2:       #f5f7fa;
  --sur3:       #eaecf0;
  /* ボーダー */
  --border:     #dde1e8;
  --border2:    #c4cad8;
  /* テキスト */
  --text:       #1a1d27;
  --muted:      #6b7280;
  --faint:      #d1d5e0;
  /* アクセントカラー */
  --accent:     #3b7ef4;
  --accent-dim: rgba(59,126,244,0.10);
  --green:      #059669;
  --green-dim:  rgba(5,150,105,0.10);
  --red:        #dc2626;
  --red-dim:    rgba(220,38,38,0.10);
  --yellow:     #d97706;
  --purple:     #7c3aed;
  --teal:       #0d9488;
  --orange:     #ea580c;
  /* 角丸 */
  --radius:     12px;
  --radius-sm:  8px;
  /* レイアウト */
  --nav-h:      62px;
  --header-h:   52px;
  /* フォント */
  --font: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
}

html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  padding-bottom: var(--nav-h);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ===== ヘッダー ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  height: var(--header-h);
  gap: 12px;
}
.header-logo {
  font-size: 1.1rem; font-weight: 700; letter-spacing: .03em;
  color: var(--accent); white-space: nowrap; text-decoration: none;
}
.header-logo span { color: var(--text); }
.header-title {
  font-size: .95rem; font-weight: 700; flex: 1; text-align: center;
}
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ===== ボタン ===== */
.btn {
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font); font-size: .85rem; font-weight: 600;
  padding: 8px 16px; transition: all .15s; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; white-space: nowrap; text-decoration: none;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover  { opacity: .85; }
.btn-secondary {
  background: var(--sur2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--sur3); }
.btn-ghost   { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--sur2); }
.btn-danger  { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.25); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon-only {
  background: var(--sur2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); cursor: pointer;
  font-size: .95rem; padding: 7px 10px; transition: background .15s;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.btn-icon-only:hover { background: var(--border); }

/* ===== フル幅タブナビ（ページ固定） ===== */
.tabs-full {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: var(--header-h); z-index: 90;
}
.tab-full-btn {
  flex: 1; padding: 11px 6px;
  font-size: .8rem; font-weight: 600;
  color: var(--muted); cursor: pointer;
  border: none; background: transparent;
  border-bottom: 2px solid transparent;
  transition: all .15s; font-family: var(--font);
  text-align: center;
}
.tab-full-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-full-btn:hover:not(.active) { color: var(--text); background: var(--sur2); }

/* ===== メインコンテンツエリア ===== */
.main {
  padding: 18px;
  max-width: 960px;
  margin: 0 auto;
}

/* ===== カード ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card + .card { margin-top: 12px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title { font-size: .9rem; font-weight: 600; }

/* ===== バッジ ===== */
.badge {
  border-radius: 4px; font-size: .68rem; font-weight: 600;
  padding: 2px 7px; display: inline-block; white-space: nowrap;
}
.badge-accent  { background: var(--accent-dim); color: var(--accent); }
.badge-green   { background: var(--green-dim);  color: var(--green);  }
.badge-red     { background: var(--red-dim);    color: var(--red);    }
.badge-muted   { background: var(--sur3);       color: var(--muted);  }
.badge-purple  { background: rgba(167,139,250,.15); color: var(--purple); }
.badge-orange  { background: rgba(251,146,60,.15);  color: var(--orange); }
.badge-yellow  { background: rgba(251,191,36,.15);  color: var(--yellow); }
.badge-teal    { background: rgba(45,212,191,.15);  color: var(--teal);   }

/* ===== ユーティリティ ===== */
.text-green  { color: var(--green)  !important; }
.text-red    { color: var(--red)    !important; }
.text-accent { color: var(--accent) !important; }
.text-muted  { color: var(--muted)  !important; }
.text-yellow { color: var(--yellow) !important; }
.text-purple { color: var(--purple) !important; }
.text-teal   { color: var(--teal)   !important; }
.text-orange { color: var(--orange) !important; }
.text-right  { text-align: right; }
.text-sm     { font-size: .8rem;  }
.text-xs     { font-size: .72rem; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px;  }
.gap-8  { gap: 8px;  }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.mt-4  { margin-top: 4px;  }
.mt-8  { margin-top: 8px;  }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px;  }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

/* ===== ボトムナビ ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  height: var(--nav-h);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; padding: 4px 10px;
  cursor: pointer; text-decoration: none;
  flex: 1;
}
.nav-icon  { font-size: 1.2rem; }
.nav-label {
  color: var(--muted); font-size: .6rem;
  font-weight: 600; letter-spacing: .04em;
}
.nav-item.active .nav-label { color: var(--accent); }

/* ===== FAB ===== */
.fab {
  display: flex; align-items: center; justify-content: center;
  position: fixed; right: 18px;
  bottom: calc(var(--nav-h) + 14px);
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--accent); border: none; color: #fff;
  font-size: 1.5rem; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 20px rgba(79,142,247,.45);
  transition: transform .15s, box-shadow .15s;
  z-index: 99;
}
.fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 24px rgba(79,142,247,.55);
}

/* ===== レスポンシブ ===== */
@media (min-width: 960px) {
  .bottom-nav { display: none; }
  .fab        { display: none; }
  body        { padding-bottom: 0; }
  .header     { padding: 12px 40px; }
  .main       { padding: 28px 40px; }
}
