@charset "UTF-8";
/* GINO 注文管理 — 画面用スタイル（iPad / PC 兼用。タップしやすい大きめの部品） */
:root {
  --bg: #f3f4f6; --card: #fff; --ink: #1f2937; --muted: #6b7280; --line: #e5e7eb;
  --brand: #1e3a5f; --brand-2: #2b5080; --accent: #b89968; --ok: #15803d; --warn: #b45309; --ng: #b91c1c;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif; }
a { color: var(--brand-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.3; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- ヘッダー ---------- */
.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 50; }
.topbar .in { max-width: 1240px; margin: auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; height: 54px; }
.topbar .brand { font-weight: 700; letter-spacing: .12em; font-size: 17px; color: #fff; }
.topbar .brand small { font-weight: 400; letter-spacing: .05em; opacity: .8; margin-left: 8px; font-size: 12px; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar nav a { color: rgba(255,255,255,.85); padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-size: 14px; }
.topbar nav a:hover { background: rgba(255,255,255,.1); }
.topbar nav a.on { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.topbar .user { font-size: 13px; opacity: .9; white-space: nowrap; }
.topbar .user button { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 4px 10px; margin-left: 8px; cursor: pointer; }

/* ---------- レイアウト ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 16px 80px; }
.wrap--narrow { max-width: 560px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card h2 { display: flex; align-items: center; gap: 10px; }
.card h2 .tag { font-size: 12px; font-weight: 500; color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { min-width: 0; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- 部品 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 16px; cursor: pointer; min-height: 40px; white-space: nowrap; }
.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--ng); border-color: #fca5a5; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn.lg { padding: 12px 22px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

label.f { display: block; }
label.f > span, .f-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=search], input[type=email], input[type=tel], select, textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 9px 11px; background: #fff; min-height: 42px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(30,58,95,.25); border-color: var(--brand-2); }
input.w-num { max-width: 120px; text-align: right; }
.unit { color: var(--muted); font-size: 13px; margin-left: 4px; }
.req { color: var(--ng); margin-left: 3px; }

/* 選択肢ボタン（紙の「丸を付ける」に相当） */
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { border: 1px solid #d1d5db; background: #fff; border-radius: 999px; padding: 7px 13px; cursor: pointer; font-size: 14px; min-height: 38px; }
.opt:hover { background: #f3f4f6; }
.opt.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.opt .n { opacity: .55; font-size: 12px; margin-right: 4px; }
.opt.on .n { opacity: .8; }
.opt.clear { color: var(--muted); border-style: dashed; }

/* 様式フォーム */
.fsec { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.fsec > h2 { margin: 0; padding: 12px 18px; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.fsec > h2 .tag { font-size: 12px; color: var(--muted); font-weight: 400; }
.fsec .fbody { padding: 10px 18px 14px; }
.frow { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #eef0f3; }
.frow:last-child { border-bottom: 0; }
.frow > .fl { font-size: 14px; font-weight: 600; }
.frow > .fl small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.frow .fc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.frow .fc input[type=text] { max-width: 360px; }
.frow .fc .hint { font-size: 12px; color: var(--muted); }
.frow.warn input { border-color: #f59e0b; background: #fffbeb; }
.num2 { display: flex; gap: 14px; flex-wrap: wrap; }
.num2 > div { display: flex; align-items: center; gap: 6px; }
.num2 > div > span:first-child { font-size: 12px; color: var(--muted); }
.fsec.off { display: none; }

/* 一覧 */
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #f8fafc; white-space: nowrap; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover { background: #f8fafc; }
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

/* ステータス */
.st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-draft { background: #e5e7eb; color: #374151; }
.st-ordered { background: #dbeafe; color: #1e40af; }
.st-sent { background: #fef3c7; color: #92400e; }
.st-arrived { background: #d1fae5; color: #065f46; }
.st-delivered { background: #f3f4f6; color: #6b7280; }
.st-cancelled { background: #fee2e2; color: #991b1b; }

/* チップ（フィルタ） */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 2px; }

/* 顧客サジェスト */
.suggest { position: relative; }
.suggest .menu { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 20; max-height: 280px; overflow: auto; }
.suggest .menu div { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.suggest .menu div:hover { background: #f3f4f6; }
.suggest .menu .new { color: var(--brand-2); font-weight: 600; }

/* 原価行 */
.cost-lines table { width: 100%; border-collapse: collapse; }
.cost-lines td { padding: 4px 4px; }
.cost-lines input[type=number] { max-width: 140px; text-align: right; }
.cost-lines select { max-width: 130px; }
.summary-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.summary-box > div { background: #f8fafc; border-radius: 8px; padding: 10px 12px; }
.summary-box .k { font-size: 12px; color: var(--muted); }
.summary-box .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-box .v.neg { color: var(--ng); }

/* 固定フッター（保存） */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 10px; align-items: center; z-index: 40; backdrop-filter: blur(6px); }
.savebar .in { max-width: 1240px; margin: auto; width: 100%; display: flex; gap: 10px; align-items: center; }
.savebar .spacer { flex: 1; }

/* トースト */
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 100; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.on { opacity: 1; }
.toast.ng { background: var(--ng); }

/* ログイン */
.login { max-width: 420px; margin: 8vh auto; }
.login .brand { text-align: center; font-size: 28px; letter-spacing: .2em; color: var(--brand); font-weight: 700; margin-bottom: 4px; }
.login .sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 13px; }
.err { color: var(--ng); font-size: 13px; min-height: 1.2em; }

/* モーダル */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }

@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .frow { grid-template-columns: 1fr; gap: 4px; }
  .topbar .brand small { display: none; }
  .wrap { padding: 12px 10px 90px; }
  .card { padding: 14px; }
}
@media (max-width: 480px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
