/* 見積の管理 画面の見た目。
   PC では1行1件の表、スマホでは1件ずつ縦に並ぶ。色は深い緑。
   状況は丸の色で見分ける：未提出＝赤紫、修正＝橙、約定＝緑 */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --ink: #1a1d21; --sub: #5b636d; --line: #d9dde3; --bg: #eef2ef; --paper: #fff;
  --accent: #1f5a3f; --accent-soft: #e8f0ea;
  --ng: #c2185b; --fix: #d97706; --ok: #1b7a3d;
}

html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--accent); }

/* ---------- ヘッダー ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--accent); color: #fff;
}
.appbar h1 { font-size: 18px; margin: 0; font-weight: 700; white-space: nowrap; }
.appbar .spacer { flex: 1; }
.appbar .who { font-size: 13px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar a { color: #fff; text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 14px 14px 40px; }

/* ---------- 入力・ボタン ---------- */
label { font-size: 12px; color: var(--sub); display: block; margin-bottom: 3px; }
input[type=text], input[type=date], input[type=password], select {
  width: 100%; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; font: inherit; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink);
  font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--ng); border-color: #e6a5c0; }
.btn:active { transform: translateY(1px); }
.hint { font-size: 12px; color: var(--sub); margin: 8px 0 0; }

/* ---------- 上の操作 ---------- */
.tools { display: grid; grid-template-columns: auto 1fr 170px 190px; gap: 10px; align-items: end; margin-bottom: 12px; }
.tools > div { min-width: 0; }

/* ---------- 一覧 ---------- */
.mt-list { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.mt-head, .mt-row { display: grid; grid-template-columns: 130px 1.4fr 1fr 130px 170px 130px; align-items: center; gap: 8px; padding: 0 14px; }
.mt-head { min-height: 36px; background: #f1f5f2; font-size: 12px; color: var(--sub); border-bottom: 1px solid var(--line); }
.mt-row { min-height: 54px; border-top: 1px solid var(--line); }
.mt-head + div > .mt-row:first-child { border-top: 0; }
.mt-site { font-weight: 700; }
.mt-meta { display: none; }
.mt-lamp { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 4px 0 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; max-width: 100%; }
.mt-lamp select { width: auto; height: auto; border: none; background: transparent; font-weight: 700; font-size: 15px; padding: 8px 2px; }
.mt-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #aab1ba; }
.mt-pending { background: var(--ng); }
.mt-revise { background: var(--fix); }
.mt-agreed { background: var(--ok); }
.mt-dl { white-space: nowrap; }
.mt-over { color: var(--ng); font-weight: 700; font-size: 13px; margin-left: 6px; }
.mt-soon { color: var(--fix); font-weight: 700; font-size: 13px; margin-left: 6px; }
.mt-none { color: var(--sub); }
.mt-ops { white-space: nowrap; text-align: right; }
.mt-ops .btn { height: 36px; padding: 0 12px; font-size: 14px; }
.mt-empty { color: var(--sub); text-align: center; padding: 22px 8px; }

@media (max-width: 720px) {
  .wrap { padding: 10px 10px 40px; }
  .tools { grid-template-columns: 1fr 1fr; }
  .tools .mt-add, .tools .mt-q { grid-column: 1 / -1; }
  .tools .btn.primary { width: 100%; }
  .mt-head { display: none; }
  .mt-row { grid-template-columns: 1fr auto; grid-template-areas: "site st" "meta st" "due ops"; gap: 2px 10px; padding: 12px 14px; }
  .mt-row:first-child { border-top: 0; }
  .mt-site { grid-area: site; font-size: 17px; }
  .mt-cust, .mt-who { display: none; }
  .mt-meta { display: block; grid-area: meta; font-size: 13px; color: var(--sub); }
  .mt-dl { grid-area: due; font-size: 14px; align-self: center; }
  .mt-st { grid-area: st; align-self: start; }
  .mt-ops { grid-area: ops; margin-top: 6px; }
}

/* ---------- 追加・変更の箱 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,25,32,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: #fff; border-radius: 4px; padding: 20px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.modal .row { margin-bottom: 12px; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions .spacer { flex: 1; }
.error { margin-top: 10px; padding: 10px 12px; border-radius: 4px; background: #fde8ee; color: var(--ng); font-size: 14px; }

/* ---------- ログイン ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 26px 24px; }
.login-box h1 { margin: 0 0 4px; font-size: 20px; }
.login-box .lead { margin: 0 0 18px; font-size: 13px; color: var(--sub); }
.login-box .btn { width: 100%; margin-top: 18px; }

.chk-row { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.chk-row input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- 知らせ ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 4px; z-index: 200; font-weight: 700; }
