/* ============================================================
   Clavis OTB Web アプリ モックアップ 共通スタイル
   ※ これはデザインイメージ確認用のモックアップです（ダミーデータ）
   ============================================================ */

:root {
  --navy: #1b2540;
  --navy-2: #243154;
  --primary: #2563eb;
  --primary-weak: #e8f0ff;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --green: #16a34a;   /* ADR */
  --blue: #2563eb;    /* 室数 */
  --red: #dc2626;     /* 満室ライン / 販売可能室数 */
  --amber: #f59e0b;   /* アラート */
  --phase: #94a3b8;   /* Phase2/3 予定枠 */
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- レイアウト ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  background: var(--navy);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand .logo {
  font-size: 17px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 9px;
}
.brand .logo .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}
.brand .sub { font-size: 11px; color: #7c8aa5; margin-top: 4px; letter-spacing: .02em; }

.nav { padding: 12px 10px; flex: 1; }
.nav .group-label {
  font-size: 10.5px; color: #64748b; letter-spacing: .08em;
  padding: 14px 12px 6px; text-transform: uppercase;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: #cbd5e1; text-decoration: none; font-size: 13.5px;
  margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav a .ico { width: 18px; text-align: center; font-size: 15px; }
.nav a .ph {
  margin-left: auto; font-size: 9.5px; background: rgba(148,163,184,.25);
  color: #cbd5e1; padding: 1px 6px; border-radius: 6px;
}

.sidebar .foot {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 10.5px; color: #64748b;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- トップバー ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar .crumb { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar .spacer { flex: 1; }
.topbar .pill {
  font-size: 11px; color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); padding: 5px 11px; border-radius: 20px;
}
.topbar .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

.content { padding: 24px 28px 48px; }

/* ---------- モックアップ注意バナー ---------- */
.mock-banner {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  padding: 8px 16px; font-size: 12px; text-align: center;
}
.mock-banner b { font-weight: 700; }

/* ---------- 汎用パーツ ---------- */
.row { display: flex; gap: 18px; flex-wrap: wrap; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head .desc { font-size: 12px; color: var(--muted); }
.card-head .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all .15s;
}
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: #1d4ed8; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); }

.badge {
  font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge.green { background: #dcfce7; color: #166534; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.amber { background: #fef3c7; color: #92400e; }
.badge.blue { background: var(--primary-weak); color: #1e40af; }
.badge.gray { background: #f1f5f9; color: #475569; }

.phase-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 6px; font-weight: 600;
  background: #f1f5f9; color: var(--phase); border: 1px dashed var(--phase);
}

select, input[type=text], input[type=month] {
  font-family: inherit; font-size: 13px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  color: var(--text);
}

/* KPI 数値 */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.kpi .value .unit { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi .delta { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.kpi .delta .up { color: var(--green); font-weight: 600; }
.kpi .delta .down { color: var(--red); font-weight: 600; }

/* 進捗バー */
.bar { height: 8px; background: #eef2f7; border-radius: 8px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 8px; }
.bar > span.b { background: var(--primary); }
.bar > span.g { background: var(--green); }
.bar > span.a { background: var(--amber); }
.bar > span.r { background: var(--red); }

/* テーブル */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid #f1f3f7; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 施設カード */
.facility-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  text-decoration: none; color: inherit; display: block;
}
.facility-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #c7d6f5; }
.facility-card .fc-head { display: flex; align-items: center; gap: 10px; }
.facility-card .fc-name { font-size: 15px; font-weight: 700; }
.facility-card .fc-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.facility-card .fc-spark { height: 48px; margin: 12px 0 8px; }
.facility-card .fc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.facility-card .fc-stat .l { font-size: 10.5px; color: var(--muted); }
.facility-card .fc-stat .v { font-size: 15px; font-weight: 700; }

/* 凡例 */
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .swatch { width: 18px; height: 3px; border-radius: 3px; }
.legend .swatch.dash { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 9px); height: 0; border-top: 2px dashed; }

/* Phase 予定枠 */
.phase-box {
  border: 1px dashed var(--phase); background: repeating-linear-gradient(45deg, #fafbfc 0 10px, #f3f5f8 10px 20px);
  border-radius: 10px; padding: 14px 16px; color: #64748b;
}
.phase-box .ph-h { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #475569; font-size: 13px; }
.phase-box p { font-size: 12px; margin-top: 6px; }

.note { font-size: 12px; color: var(--muted); }
.section-title { font-size: 13px; font-weight: 700; color: #374151; margin: 4px 0 12px; }

/* アラート行 */
.alert-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: 9px; background: #fffbeb; border: 1px solid #fde68a; margin-bottom: 8px;
}
.alert-row.danger { background: #fef2f2; border-color: #fecaca; }
.alert-row .a-ico { font-size: 18px; }
.alert-row .a-txt { font-size: 13px; }
.alert-row .a-txt b { font-weight: 700; }
.alert-row .spacer { flex: 1; }

/* メモ */
.memo-item { padding: 12px 0; border-bottom: 1px solid #f1f3f7; }
.memo-item:last-child { border: none; }
.memo-item .m-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.memo-item .m-body { font-size: 13px; margin-top: 4px; }
.memo-input {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px;
  font-family: inherit; font-size: 13px; resize: vertical; min-height: 64px;
}

/* 取込ステップ */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step {
  flex: 1; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; font-size: 12.5px; color: var(--muted);
}
.step.active { border-color: var(--primary); background: var(--primary-weak); color: #1e40af; font-weight: 600; }
.step.done { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.step .n { font-weight: 700; margin-right: 6px; }

.dropzone {
  border: 2px dashed #c7d2e0; border-radius: 12px; padding: 36px; text-align: center;
  background: #fafcff; color: var(--muted);
}
.dropzone .dz-ico { font-size: 34px; }
.dropzone .dz-t { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 8px; }

.map-row { display: grid; grid-template-columns: 1fr 30px 1fr; align-items: center; gap: 10px; padding: 8px 0; }
.map-row .arrow { text-align: center; color: var(--muted); }
.chip { font-size: 12px; background: var(--bg); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; }

.check-ok { color: var(--green); font-weight: 600; }
.check-warn { color: var(--amber); font-weight: 600; }
.check-err { color: var(--red); font-weight: 600; }

/* レポートプレビュー */
.report-paper {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 32px 36px; max-width: 720px; margin: 0 auto;
}
.report-paper .r-head { display: flex; align-items: flex-start; border-bottom: 2px solid var(--navy); padding-bottom: 14px; }
.report-paper .r-title { font-size: 19px; font-weight: 700; }
.report-paper .r-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.report-paper .r-logo { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }

/* ---------- ブッキングカレンダー ---------- */
.cal {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border); border-top: 1px solid var(--border);
}
.cal .dow {
  background: #f8fafc; padding: 8px; text-align: center; font-size: 12px; font-weight: 700;
  color: #475569; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.cal .dow.sun { color: #dc2626; }
.cal .dow.sat { color: #2563eb; }
.cal .cell {
  position: relative; min-height: 104px; padding: 6px 7px 4px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: #fff; cursor: pointer; transition: background .12s; text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.cal .cell:hover { background: #eff5ff; }
.cal .cell.empty { background: #f8fafc; cursor: default; }
.cal .cell.lag { background: #fef4f4; }     /* 予約ペース遅延（値下げ検討） */
.cal .cell.hot { background: #fff7ed; }      /* 予約ペース過熱（値上げ検討） */
.cal .cell .d { font-size: 13px; font-weight: 700; }
.cal .cell .d.sun { color: #dc2626; }
.cal .cell .d.sat { color: #2563eb; }
.cal .cell .occ {
  position: absolute; top: 6px; right: 7px; font-size: 10px; color: #475569;
  background: #f1f5f9; padding: 0 5px; border-radius: 5px; font-variant-numeric: tabular-nums;
}
.cal .cell .alert-dot {
  position: absolute; top: 24px; right: 9px; width: 7px; height: 7px; border-radius: 50%;
}
.cal .cell .alert-dot.lag { background: #dc2626; }
.cal .cell .alert-dot.hot { background: #f97316; }
.cal .cell .mini { margin-top: auto; height: 46px; width: 100%; }
.cal .cell .mini svg { width: 100%; height: 100%; display: block; }

.heat-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.heat-legend .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); display: inline-block; vertical-align: -2px; margin-right: 5px; }

/* ---------- 価格調整フォーム ---------- */
.price-form { border: 1px solid #bfdbfe; background: #f8fbff; border-radius: 12px; padding: 16px 18px; }
.price-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #eef2f7; }
.price-row:last-of-type { border-bottom: none; }
.price-row .rt { font-size: 13px; font-weight: 600; }
.price-row .ctrl { display: flex; align-items: center; gap: 8px; }
.price-row .old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.price-row input[type=number] { width: 96px; text-align: right; font-size: 13px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
.price-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
