/* LocoField — モバイルファースト。白・緑・グレー基調の信頼感あるSaaSデザイン。 */
:root {
  --green: #1f9d6b;
  --green-dark: #157a52;
  --green-light: #e8f6f0;
  --gray-900: #1a1f24;
  --gray-700: #3f4a52;
  --gray-500: #6b7680;
  --gray-300: #d3d9de;
  --gray-100: #f3f5f7;
  --white: #ffffff;
  --red: #d64545;
  --amber: #e0a106;
  --blue: #2f80ed;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', Meiryo, sans-serif;
  color: var(--gray-900);
  background: var(--gray-100);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-dark); }

.view { padding: 16px; max-width: 720px; margin: 0 auto; }

/* ---- 認証画面 ---- */
.auth-view { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.brand { text-align: center; }
.logo { font-size: 34px; font-weight: 800; color: var(--green); letter-spacing: -0.02em; }
.tagline { font-size: 18px; font-weight: 700; margin: 6px 0 2px; }
.subtagline { color: var(--gray-500); font-size: 13px; margin: 0; }

/* ---- カード ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 10px; font-size: 17px; }

/* ---- フォーム ---- */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--gray-700); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; font-size: 16px;
  border: 1.5px solid var(--gray-300); border-radius: 10px; background: var(--white);
}
.field input:focus { outline: none; border-color: var(--green); }

/* ---- ボタン（大きめ・タップしやすく） ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 18px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px; cursor: pointer; min-height: 48px;
}
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:active { background: var(--green-dark); }
.btn-block { width: 100%; }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-700); }

/* ---- アプリヘッダ / コンテンツ / 下部ナビ ---- */
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--white); border-bottom: 1px solid var(--gray-300);
}
.app-title { font-weight: 800; font-size: 18px; }
.app-content { padding-bottom: 86px; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--white); border-top: 1px solid var(--gray-300);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; background: none; border: none; cursor: pointer;
  font-size: 11px; color: var(--gray-500); font-weight: 600;
}
.nav-btn span { font-size: 20px; }
.nav-btn.is-active { color: var(--green); }

/* ---- 今日やること: 数値タイル ---- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--white); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.tile .num { font-size: 28px; font-weight: 800; color: var(--green); }
.tile .num.warn { color: var(--amber); }
.tile .num.alert { color: var(--red); }
.tile .lbl { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* ---- リスト項目 ---- */
.list-item {
  background: var(--white); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); margin-bottom: 10px; display: flex; align-items: center; gap: 12px;
}
.list-item .main { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; font-size: 15px; }
.list-item .sub { color: var(--gray-500); font-size: 12px; }

/* ---- ステータスバッジ（色分け） ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge.green { background: var(--green-light); color: var(--green-dark); }
.badge.amber { background: #fdf3d7; color: #8a6400; }
.badge.red { background: #fbe3e3; color: #a32626; }
.badge.blue { background: #e4eefc; color: #1d5fc0; }
.badge.gray { background: var(--gray-100); color: var(--gray-500); }

/* ---- 汎用 ---- */
.muted { color: var(--gray-500); }
.small { font-size: 12px; }
.error { color: var(--red); font-size: 13px; }
.loading { text-align: center; color: var(--gray-500); padding: 40px 0; }
.section-head { font-size: 13px; font-weight: 700; color: var(--gray-700); margin: 18px 0 8px; }
.empty { text-align: center; color: var(--gray-500); padding: 30px 0; font-size: 14px; }
.disclaimer { font-size: 11px; color: var(--gray-500); background: var(--gray-100); padding: 10px 12px; border-radius: 10px; margin-top: 12px; }
.legal-links { text-align: center; }

/* 小さめボタン / 戻る / 危険 */
.btn.mini {
  padding: 8px 12px; min-height: auto; font-size: 13px; margin-left: 8px;
  background: var(--green-light); color: var(--green-dark);
}
.btn.mini.danger { background: #fbe3e3; color: #a32626; }
.back-btn {
  background: none; color: var(--gray-700); padding: 6px 0; min-height: auto;
  font-size: 14px; margin-bottom: 6px;
}
.section-head .btn.mini { float: right; }

/* 明細エディタ */
.li-row {
  display: grid;
  grid-template-columns: 1fr 64px 84px 78px 32px;
  gap: 6px; margin-bottom: 8px; align-items: center;
}
.li-row input, .li-row select {
  padding: 10px 8px; font-size: 14px; border: 1.5px solid var(--gray-300); border-radius: 8px; width: 100%;
}
.li-row .li-del {
  background: #fbe3e3; color: #a32626; border: none; border-radius: 8px; height: 38px; font-size: 16px; cursor: pointer;
}
