/* VegeShip 共通スタイル (モバイルファースト・参考アプリ風の黄緑テーマ) */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #c9eb9e;
  --bg-light: #d8f2b4;
  --header-bg: #ffffff;
  --accent: #3f6212;
  --accent-dark: #2f4a0d;
  --blue: #2f9be4;
  --blue-dark: #1d7fc4;
  --green-btn: #6aab3c;
  --green-btn-dark: #558a2f;
  --red: #d94040;
  --card: #ffffff;
  --shadow: 0 4px 0 rgba(70, 100, 40, .35);
  --input-bg: #eef4fb;
}

html { font-size: 16px; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background: var(--bg);
  color: #1c2a10;
  min-height: 100vh;
}

/* ---------- ヘッダ ---------- */
.app-header { background: var(--header-bg); padding: .6rem .9rem; }
.app-header-inner { display: flex; justify-content: space-between; align-items: flex-start; max-width: 640px; margin: 0 auto; }
.app-name { font-size: .78rem; color: #333; }
.page-title { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.header-site { font-size: .9rem; color: #333; }
.header-producer { font-size: .9rem; color: #333; }
.hamburger { background: none; border: none; cursor: pointer; padding: .4rem; }
.hamburger span { display: block; width: 34px; height: 5px; background: var(--accent); margin: 5px 0; border-radius: 2px; }

/* ---------- 本文 ---------- */
.app-main { max-width: 640px; margin: 0 auto; padding: 1rem .9rem 5rem; }

.lead {
  border-left: 6px solid var(--accent);
  padding: .2rem 0 .2rem .6rem;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.lead .lead-strong { font-weight: 700; }

.section-label { font-size: 1.05rem; margin: 1rem 0 .6rem; display: flex; align-items: center; gap: .6rem; }
.section-label::after { content: ""; flex: 1; height: 3px; background: var(--accent); }

/* ---------- ボタン ---------- */
.big-btn {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  background: var(--card); color: #111;
  border: none; border-radius: 14px;
  box-shadow: var(--shadow);
  width: 100%; padding: 1.1rem .8rem;
  font-size: 1.55rem; font-weight: 700;
  text-decoration: none; text-align: center;
  margin-bottom: 1.2rem; cursor: pointer;
}
.big-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(70,100,40,.35); }
.big-btn .btn-icon { font-size: 1.6rem; }
.big-btn.small-text { font-size: 1.2rem; }

.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: none; border-radius: 999px; cursor: pointer;
  font-size: 1.15rem; font-weight: 700; text-decoration: none;
  padding: .85rem 1.6rem;
  box-shadow: var(--shadow);
}
.pill-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(70,100,40,.35); }
.back-btn { background: var(--card); color: #111; }
.next-btn { background: var(--blue); color: #fff; }
.danger-btn { background: var(--red); color: #fff; }
.green-btn { background: var(--green-btn); color: #fff; }

.footer-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  max-width: 640px; margin: 0 auto; padding: .8rem .9rem 1rem;
  pointer-events: none;
}
.footer-nav > * { pointer-events: auto; }
.footer-nav .spacer { flex: 1; }
.footer-nav-left { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }

/* ---------- ログイン ---------- */
.login-wrap { text-align: center; padding-top: 1.5rem; }
.login-label { font-size: 2.2rem; font-weight: 700; margin-bottom: .4rem; }
.login-input-row { position: relative; margin-bottom: 1.4rem; }
.login-input {
  width: 100%; max-width: 480px;
  font-size: 1.6rem; padding: .7rem .9rem;
  border: 2px solid #999; border-radius: 8px;
  background: #fff; box-shadow: inset 2px 2px 4px rgba(0,0,0,.15);
}
.toggle-pw {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  background: #e8e8e8; border: none; border-radius: 8px;
  padding: .6rem .7rem; font-size: .95rem; cursor: pointer;
}
.login-submit {
  width: 100%; max-width: 480px;
  background: var(--blue); color: #fff;
  border: none; border-radius: 16px;
  font-size: 2.2rem; font-weight: 700;
  padding: .9rem; margin-top: 1.5rem; cursor: pointer;
  box-shadow: 0 5px 0 var(--blue-dark);
}
.login-submit:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-dark); }

/* ---------- フォーム ---------- */
.field { margin-bottom: 1rem; }
.field-label { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; display: flex; align-items: center; gap: .4rem; }
.field-label::before { content: "●"; font-size: .8rem; }
.field-input {
  width: 100%; font-size: 1.4rem; padding: .7rem .8rem;
  border: 2px solid #9ab0c6; border-radius: 10px;
  background: var(--input-bg); box-shadow: inset 2px 2px 4px rgba(0,0,0,.12);
}
.field-input:focus { outline: 3px solid #f0a828; }
.field-input::placeholder { color: #b0bcc8; }
.field-note { font-size: .85rem; color: #444; margin-top: .25rem; }

/* ---------- カード / 明細 ---------- */
.card { background: var(--card); border-radius: 16px; padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.bullet-note { display: flex; gap: .4rem; align-items: baseline; margin-bottom: .5rem; font-size: 1rem; }
.bullet-note::before { content: "●"; color: var(--green-btn); font-size: .8rem; }

.detail-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.detail-table th, .detail-table td { padding: .45rem .3rem; text-align: right; white-space: nowrap; }
.detail-table th { font-weight: 700; border-bottom: 2px solid #ddd; }
.detail-table td { border-bottom: 1px solid #eee; }
.detail-table .cell-left { text-align: left; }
.detail-table tr.clickable { cursor: pointer; }
.detail-table tr.clickable:active { background: #f3f9ec; }

.totals-row { display: flex; justify-content: flex-end; gap: 1.6rem; font-size: 1.1rem; padding: .6rem .4rem; }
.totals-row .totals-label { font-weight: 700; }

.remarks-row { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; margin: .8rem 0 1rem; }
.remarks-row label { font-size: 1.15rem; font-weight: 700; }
.remarks-row input { width: 10rem; font-size: 1.2rem; padding: .5rem; border: 2px solid #9ab0c6; border-radius: 8px; background: var(--input-bg); }

/* ---------- ハンバーガーメニュー ---------- */
.menu-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: var(--bg); padding: 1rem .9rem;
  overflow-y: auto;
}
.menu-overlay.open { display: block; }
.menu-close {
  display: block; margin-left: auto;
  background: none; border: none;
  font-size: 2.6rem; color: var(--accent); font-weight: 700; cursor: pointer;
}
.menu-nav { max-width: 640px; margin: 3rem auto 0; }
.menu-logout { display: flex; justify-content: center; align-items: center; gap: .5rem; font-size: 1.8rem; font-weight: 700; color: #111; text-decoration: none; margin-top: .5rem; }
.menu-back { position: fixed; bottom: 1.2rem; left: .9rem; }

/* ---------- モーダル ---------- */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(40, 60, 25, .55);
  padding: 3.5rem 1rem;
}
.modal-backdrop.open { display: block; }
.modal-card {
  background: #fff; border-radius: 20px;
  max-width: 560px; margin: 0 auto;
  padding: 2rem 1.4rem 2.5rem; text-align: center;
}
.modal-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.4rem; line-height: 1.6; }
.modal-btn { width: 100%; max-width: 420px; margin: 0 auto 1.2rem; display: flex; }
.modal-choice { display: flex; flex-direction: column; gap: 1.4rem; align-items: stretch; max-width: 420px; margin: 0 auto; }
.site-choice { display: block; font-size: 1.9rem; font-weight: 700; color: #111; text-decoration: none; text-align: left; padding: .4rem 0; margin-left: 1.5rem; }

/* ---------- テンキー ---------- */
.numpad {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #d4d4d4; padding: .8rem .8rem 1.1rem;
}
.numpad.open { display: block; }
.numpad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; max-width: 640px; margin: 0 auto; }
.numpad-key {
  background: #fff; border: none; border-radius: 10px;
  font-size: 1.9rem; font-weight: 600; padding: .55rem 0;
  box-shadow: 0 3px 0 rgba(0,0,0,.25); cursor: pointer;
}
.numpad-key:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.numpad-key.disabled { background: #c2c2c2; color: #888; box-shadow: none; }
.numpad-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; max-width: 640px; margin: .8rem auto 0; }
.numpad-clear {
  background: #fff; color: #111; border: none; font-size: 1.5rem; font-weight: 700;
  padding: .7rem; border-radius: 10px; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.25);
  position: relative;
}
.numpad-clear .clear-label { background: #111; color: #fff; padding: .35rem 1rem .35rem 1.6rem; clip-path: polygon(18% 0, 100% 0, 100% 100%, 18% 100%, 0 50%); font-size: 1.3rem; }
.numpad-ok {
  background: var(--blue); color: #fff; border: none; font-size: 1.6rem; font-weight: 700;
  padding: .7rem; border-radius: 10px; cursor: pointer; box-shadow: 0 3px 0 var(--blue-dark);
}
body.numpad-open { padding-bottom: 22rem; }

/* ---------- 選択式パネル (等階級・荷姿など) ---------- */
.choicepad {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #d4d4d4; padding: .8rem .8rem 1.1rem;
}
.choicepad.open { display: block; }
.choicepad-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem;
  max-width: 640px; margin: 0 auto;
  max-height: 40vh; overflow-y: auto; padding: .1rem;
}
.choice-key {
  background: #fff; border: none; border-radius: 10px;
  font-size: 1.05rem; font-weight: 600; padding: .65rem .2rem;
  box-shadow: 0 3px 0 rgba(0,0,0,.25); cursor: pointer;
}
.choice-key:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.choice-key.selected { background: #cfe8ff; border: 2px solid var(--blue); }
.choicepad-bottom { max-width: 640px; margin: .8rem auto 0; }
.choicepad-ok {
  display: block; width: 100%;
  background: var(--blue); color: #fff; border: none; font-size: 1.4rem; font-weight: 700;
  padding: .7rem; border-radius: 10px; cursor: pointer; box-shadow: 0 3px 0 var(--blue-dark);
}
body.choicepad-open { padding-bottom: 46vh; }

/* ---------- 日付入力 ---------- */
.date-title { text-align: center; font-size: 2.4rem; font-weight: 700; margin: 1rem 0; }
.date-display {
  display: block; width: 100%; max-width: 480px; margin: 0 auto 1.4rem;
  background: var(--input-bg); border: 2px solid #9ab0c6; border-radius: 10px;
  font-size: 2rem; text-align: center; padding: .8rem .4rem;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,.12);
}
.date-cal-btn { display: block; margin: 0 auto; background: var(--blue); border: none; border-radius: 12px; font-size: 2.4rem; padding: .5rem .9rem; cursor: pointer; color: #fff; }
input.native-date { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ---------- 完了画面 ---------- */
.done-message { text-align: center; font-size: 1.7rem; font-weight: 700; line-height: 1.8; margin-top: 3rem; }
.done-sub { text-align: center; font-size: 1.5rem; margin-top: 2.5rem; line-height: 1.9; }
.done-date { color: #e02020; font-size: 2.2rem; font-weight: 700; }

/* ---------- フラッシュ ---------- */
.flash { border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; font-size: 1.05rem; }
.flash-success { background: #e6f6d8; border: 2px solid var(--green-btn); }
.flash-error { background: #fde4e4; border: 2px solid var(--red); }

/* ---------- 管理画面 ---------- */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: .92rem; }
.admin-table th, .admin-table td { padding: .55rem .6rem; border-bottom: 1px solid #e2e8d8; text-align: left; }
.admin-table th { background: #eaf4dc; }
.admin-card { background: #fff; border-radius: 12px; padding: 1.1rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.admin-card h2 { font-size: 1.15rem; margin-bottom: .7rem; border-left: 5px solid var(--accent); padding-left: .5rem; }
.admin-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .8rem; }
.badge { display: inline-block; border-radius: 999px; padding: .12rem .6rem; font-size: .8rem; color: #fff; }
.badge-pending { background: #d79b26; }
.badge-sent { background: var(--green-btn); }
.badge-failed { background: var(--red); }
.table-scroll { overflow-x: auto; }

@media (min-width: 640px) {
  html { font-size: 17px; }
}
