/* 案件ボード共通スタイル(keibi-appと同じブランド色: ネイビー×シアン×アンバー) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: #f2f4f7; color: #1f2937; line-height: 1.6;
}
a { color: #0e7490; }

.header {
  background: linear-gradient(115deg, #16324f 0%, #1e3a5f 60%, #0CB6D5 145%);
  color: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 18px;
}
.header h1 { font-size: 17px; font-weight: 800; }

/* 管理ナビ(ボタン風ピル・現在ページはシアンで点灯) */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  color: #dbeef5; background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: background 0.15s, transform 0.05s;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.nav-btn:active { transform: translateY(1px); }
.nav-btn.active {
  background: #0CB6D5; border-color: #0CB6D5; color: #fff;
  box-shadow: 0 2px 8px rgba(12, 182, 213, 0.4);
}

/* ナビのドロップダウン(2026-07-22 ナビ整理: たまに使うページを「データ」「設定」に格納) */
.nav-group { position: relative; }
.nav-group .nav-btn { font-family: inherit; cursor: pointer; }
.nav-caret { font-size: 10px; opacity: .8; }
.nav-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  min-width: 170px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18); padding: 6px; display: flex; flex-direction: column;
}
.nav-menu a {
  display: block; padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 700; color: #16324f; text-decoration: none; white-space: nowrap;
}
.nav-menu a:hover { background: #f0f9ff; }
.nav-menu a.active { background: #e0f7fb; color: #0e7490; }

/* 管理画面のコンテナ。案件一覧の横スクロール解消のため全幅寄りに変更(2026-07-22)。
   超ワイドモニタで間延びしないよう 1600px で頭打ちにする */
.container { max-width: 1600px; margin: 0 auto; padding: 16px 22px; }
.card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.card h2 { font-size: 16px; color: #16324f; margin-bottom: 12px; }

table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 9px 10px; text-align: left; }
th { background: #f8fafc; color: #64748b; font-weight: 700; white-space: nowrap; }

input, select, textarea {
  font-size: 14px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px;
  font-family: inherit;
}
label { font-size: 12.5px; color: #475569; font-weight: 700; display: block; margin-bottom: 3px; }
.field { margin-bottom: 12px; }

button, .btn {
  font-size: 14px; border: none; border-radius: 8px; padding: 9px 16px;
  font-weight: 700; cursor: pointer; background: #0CB6D5; color: #fff;
  text-decoration: none; display: inline-block;
}
button.secondary, .btn.secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; }
button.danger { background: #fff; color: #b91c1c; border: 1px solid #fecaca; }

.chip { display: inline-block; font-size: 11.5px; border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.chip.draft     { background: #f1f5f9; color: #475569; }
.chip.requesting{ background: #fef3c7; color: #92400e; }
.chip.accepted  { background: #dcfce7; color: #166534; }
.chip.staffed   { background: #dbeafe; color: #1e40af; }
.chip.declined  { background: #e5e7eb; color: #4b5563; }
.chip.cancelled { background: #fee2e2; color: #b91c1c; }
.chip.completed { background: #dcfce7; color: #166534; }
.chip.sent      { background: #fef3c7; color: #92400e; }
.chip.viewed    { background: #e0f2fe; color: #075985; }
.chip.patrol    { background: #ede9fe; color: #5b21b6; }  /* 巡回警備(2026-07-25) */

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; }
.kpi .label { font-size: 12px; color: #64748b; font-weight: 700; }
.kpi .value { font-size: 30px; font-weight: 800; color: #16324f; }
.kpi .unit { font-size: 13px; color: #94a3b8; margin-left: 4px; font-weight: 600; }

/* ダッシュボードの「直近の依頼」リスト(モック準拠の行スタイル) */
.list { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid #eef2f6;
  text-decoration: none; color: inherit;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #f8fafc; }
.list-title { font-size: 14px; font-weight: 700; color: #16324f; }
.list-sub { font-size: 12px; color: #64748b; margin-top: 1px; }

.msg-ok  { color: #166534; font-size: 13px; }
.msg-err { color: #b91c1c; font-size: 13px; }

/* ── 公開案内ページ(ランディング) ────────────────────────────── */
.lp { background: #fff; }
.lp-inner { max-width: 980px; margin: 0 auto; padding: 0 24px; }
.lp-section { padding: 64px 24px; }
.lp-hero {
  background: linear-gradient(135deg, #0f2740 0%, #1e3a5f 55%, #0a6f86 130%);
  color: #fff; padding: 96px 0 88px; text-align: center;
}
.lp-kicker { font-size: 14px; font-weight: 800; letter-spacing: .18em; color: #7dd8ea; margin-bottom: 18px; }
.lp-hero h1 { font-size: 44px; font-weight: 800; line-height: 1.4; }
.lp-lead { font-size: 16px; color: #cbe9f2; margin-top: 20px; line-height: 2; }
.lp-cta { margin-top: 32px; display: flex; gap: 12px; justify-content: center; }
.lp-btn { font-size: 15px; padding: 12px 26px; border-radius: 999px; }
.lp-h2 { font-size: 26px; font-weight: 800; color: #16324f; text-align: center; margin-bottom: 36px; }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-feature {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 28px 24px;
}
.lp-icon { font-size: 34px; margin-bottom: 12px; }
.lp-feature h3 { font-size: 16.5px; color: #16324f; margin-bottom: 10px; }
.lp-feature p { font-size: 13.5px; color: #475569; line-height: 1.9; }
.lp-flow-band { background: linear-gradient(115deg, #16324f 0%, #1e3a5f 70%, #0a6f86 140%); }
.lp-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.lp-step {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px; padding: 22px 18px; color: #fff;
}
.lp-step span {
  display: inline-flex; width: 34px; height: 34px; border-radius: 50%;
  background: #F5A623; color: #16324f; font-weight: 800; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.lp-step b { display: block; font-size: 15.5px; margin-bottom: 6px; }
.lp-step p { font-size: 12.5px; color: #cbe9f2; line-height: 1.8; }
/* ── 元請け依頼フォーム(/c/…) ────────────────────────────────── */
.req-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.req-grid .span2 { grid-column: span 2; }
@media (max-width: 680px) {
  .req-grid { grid-template-columns: 1fr 1fr; }
  .req-grid .span2 { grid-column: 1 / -1; }
  input, select, textarea { font-size: 16px; } /* iOSの自動ズーム防止 */
}
/* 空き状況カレンダー(元請けページ・タップで日付選択) */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 10px;
  padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; min-height: 66px; font-family: inherit;
}
.cal-cell.stock { background: #f0fdf4; border-color: #bbf7d0; }
.cal-cell:active { transform: translateY(1px); }
.cal-cell.selected { background: #16a34a; border-color: #16a34a; box-shadow: 0 2px 8px rgba(22,163,74,.4); }
.cal-cell.selected .cal-date, .cal-cell.selected .cal-stock,
.cal-cell.selected .cal-none, .cal-cell.selected .cal-q,
.cal-cell.selected .cal-date small { color: #fff !important; }
.cal-date { font-size: 13px; font-weight: 800; color: #16324f; }
.cal-date small { font-size: 10px; margin-left: 1px; font-weight: 600; }
.cal-stock { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; font-weight: 700; color: #166534; align-items: center; }
.cal-q { font-size: 10px; color: #0e7490; font-weight: 700; }
.cal-none { font-size: 10px; color: #94a3b8; }
@media (max-width: 680px) {
  .cal-cell { min-height: 58px; padding: 6px 2px; }
  .cal-date { font-size: 12px; }
}

/* タップできる空き状況チップ */
.chip-btn {
  border: 1px solid #86efac; background: #dcfce7; color: #166534;
  border-radius: 999px; padding: 9px 16px; font-size: 13.5px; font-weight: 700;
  cursor: pointer;
}
.chip-btn:active { transform: translateY(1px); }
.chip-btn.selected { background: #16a34a; border-color: #16a34a; color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,.4); }

/* ── 協力会社ポータル(/s/…)のタブ(2026-07-22 回答+余剰の統合) ── */
.portal-tabs { display: flex; gap: 8px; margin-top: 12px; }
.portal-tab {
  flex: 1; text-align: center; padding: 12px 8px; border-radius: 12px;
  background: #fff; border: 1px solid #e2e8f0; font-weight: 800; font-size: 14px;
  color: #475569; text-decoration: none;
}
.portal-tab.active { background: #16324f; border-color: #16324f; color: #fff; }
.portal-badge {
  display: inline-block; background: #ef4444; color: #fff; border-radius: 999px;
  font-size: 11px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px;
}

/* 余剰カレンダーの曜日ヘッダとロックセル(2026-07-22 タップ式カレンダーUI) */
.sur-wd { text-align: center; font-size: 11px; font-weight: 800; }
.cal-cell.sur-locked { opacity: .55; }

/* 案件一覧のその場依頼ポップアップ(2026-07-23 二刀流: 詳細を開かず依頼) */
.req-pop { position: relative; display: inline-block; }
.req-pop > summary {
  cursor: pointer; color: #0e7490; list-style: none; text-decoration: underline;
}
.req-pop > summary::-webkit-details-marker { display: none; }
.req-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  width: 300px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .22); padding: 12px;
  white-space: normal; text-align: left;
}
.req-panel-title {
  font-size: 12.5px; font-weight: 800; color: #16324f; margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.req-panel-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  border-bottom: 1px solid #f1f5f9; font-size: 13px; font-weight: 600; cursor: pointer;
}
.req-panel-row:hover { background: #f0f9ff; }
.req-panel-row input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; }
.req-panel-row input[type="checkbox"]:disabled + span { opacity: .6; }

/* 案件詳細の依頼先ピッカー(2026-07-23 チェック式): 会社カード+当日余剰表示 */
.partner-pick {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px;
  cursor: pointer; background: #fff;
}
.partner-pick:hover { background: #f0f9ff; border-color: #7dd8ea; }
.partner-pick.off { opacity: .65; cursor: default; background: #f8fafc; }
.partner-pick input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }
.partner-pick b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partner-sur { display: block; font-size: 11.5px; color: #64748b; font-weight: 600; margin-top: 1px; }

/* 元請けページの案件カレンダー: 日ごとの件数・人数バッジ(2026-07-22) */
.pcal-badge { font-size: 10.5px; font-weight: 800; border-radius: 6px; padding: 1px 5px; white-space: nowrap; }
.pcal-badge.pending { background: #fef3c7; color: #92400e; }  /* 手配中を含む日 */
.pcal-badge.done    { background: #dcfce7; color: #166534; }  /* 全て隊員確定以上 */
.cal-cell.selected .pcal-badge { background: rgba(255,255,255,.25); color: #fff; }

/* ── 余剰カレンダー入力(協力会社ページ /s/…) ────────────────── */
.sur-day { border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.sur-day.locked { background: #f1f5f9; opacity: .75; }
.sur-date { font-size: 15px; font-weight: 800; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sur-lock { font-size: 11.5px; color: #94a3b8; font-weight: 600; }
.sur-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; flex-wrap: wrap; }
.sur-shift { font-size: 13.5px; font-weight: 700; width: 74px; color: #334155; }
.sur-stepper { display: flex; align-items: center; gap: 2px; }
.sur-stepper button {
  width: 44px; height: 44px; border-radius: 12px; font-size: 22px; font-weight: 800;
  background: #f1f5f9; color: #16324f; border: 1px solid #cbd5e1; padding: 0;
}
.sur-stepper button:disabled { opacity: .35; }
.sur-count { min-width: 56px; text-align: center; font-size: 22px; font-weight: 800; color: #94a3b8; }
.sur-count.has { color: #166534; }
.sur-count small { font-size: 12px; margin-left: 2px; font-weight: 600; }
.sur-q { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: #475569; font-weight: 600; cursor: pointer; }
.sur-q.off { opacity: .5; }
.sur-q input { width: 18px; height: 18px; }

/* ── スマホ調整(2026-08-07 CEO指示) ──────────────────────────────
   元請けページはスマホでは「依頼を送る・状況を確認する」に絞る。
   .pc-only を付けたカード(ファイル一括依頼・空き状況カレンダー)はスマホで隠す */
@media (max-width: 680px) {
  .pc-only { display: none !important; }
  .container { padding: 12px 10px; }
  .card { padding: 14px 12px; }
  /* 表はカード内で横スクロールさせ、ページ全体は横に揺れないようにする */
  .card table { display: block; overflow-x: auto; white-space: nowrap; font-size: 12.5px; }
  .header h1 { font-size: 15px; }
}

.lp-footer {
  border-top: 1px solid #e2e8f0; padding: 26px; text-align: center;
  font-size: 12.5px; color: #94a3b8;
}
@media (max-width: 760px) {
  .lp-hero h1 { font-size: 30px; }
  .lp-features, .lp-steps { grid-template-columns: 1fr; }
}

/* ── DB風データグリッド(管理・案件一覧 2026-07-14) ────────────── */
.filterbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px;
}
.filterbar input[type="search"] { min-width: 240px; flex: 1; }
.filterbar select, .filterbar input { font-size: 13.5px; }
.gridwrap {
  overflow: auto; max-height: 70vh;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fff;
}
.dbgrid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.dbgrid thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f8fafc; border-bottom: 2px solid #e2e8f0;
  padding: 8px 10px; white-space: nowrap; font-size: 12px; color: #475569; text-align: left;
}
.dbgrid td { padding: 6px 10px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; vertical-align: middle; }
.dbgrid tbody tr:hover { background: #f0f9ff; }
/* 過去の日付の行(既定の「直近」並びで下に流れる分)。薄くして未来分と見分ける(2026-07-22) */
.dbgrid tbody tr.past { opacity: .55; }
.dbgrid tbody tr.past:hover { opacity: 1; }
.dbgrid td.wrap { white-space: normal; min-width: 200px; }
/* 長い社名は折り返してよい列(横スクロールを出さないため。2026-07-22) */
.dbgrid td.soft { white-space: normal; }
/* 行の2段目(請求No・区分・工事番号・メモなどの補足情報。列を絞った分をここに集約) */
.rowsub {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: #64748b; margin-top: 2px; font-weight: 600;
}
.rowsub code { font-size: 11px; color: #0e7490; background: #ecfeff; padding: 0 5px; border-radius: 4px; }

/* 案件詳細の前後ナビ(2026-07-23): 一覧に戻らず矢印で次の案件へスライド移動 */
.proj-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.proj-nav-btn {
  max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px;
}
.proj-nav-empty { color: #94a3b8; font-size: 12.5px; }

/* リンク風のボタン(フォーム送信をリンクの見た目で出したいとき用。一覧の「委託書」等) */
button.linklike {
  background: none; border: none; padding: 0; border-radius: 0;
  color: #0e7490; font-size: inherit; font-weight: 400;
  text-decoration: underline; cursor: pointer;
}

/* 日付の区切り行(2026-07-23): 日付順の並びで日ごとにグループ化して見やすくする */
.dbgrid tr.date-sep td {
  background: #eef4fa; color: #16324f; font-weight: 800; font-size: 12.5px;
  border-top: 2px solid #d9e5f0; border-bottom: 1px solid #d9e5f0; padding: 6px 10px;
}
.dbgrid tr.date-sep:hover { background: inherit; }
.date-sep-sum { color: #0e7490; margin-left: 10px; font-weight: 700; }

/* キズク連携のインライントグル */
.kz-btn {
  border: 1px solid #cbd5e1; background: #f8fafc; color: #94a3b8;
  border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.kz-btn.on { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 800; }
.kz-btn:active { transform: translateY(1px); }

/* 折りたたみ式の登録フォーム */
.collapse-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 16px;
}
.collapse-card > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 800; color: #16324f; list-style: none; font-size: 15px;
}
.collapse-card > summary::-webkit-details-marker { display: none; }
.collapse-card > summary:hover { background: #f8fafc; border-radius: 12px; }
.collapse-card[open] > summary { border-bottom: 1px solid #e2e8f0; }
.collapse-card .inner { padding: 16px 18px; }
