/* ------------------------------------------
 * admin.css（管理画面・簡易スタイル）
 *
 * 2025-08-27 07:41 新規作成版
 * 2025-08-27 09:38 style追加版
 * 2025-08-27 18:20 個別メンテの色反映を強化（.toggle-item 必須／on=青, off=赤）
 * 2025-08-31 微整備：変数の重複解消・スタイル小整理
 * 2025-09-03 表示修正：
 *   - textarea と補足 small が横並びになる不具合を修正（縦並びにする）
 *   - CSSの区切りを半角スペースに統一（タブ区切りを廃止）
 *   - mono クラスの見やすさ調整
 * 2025-09-04 統合整理：
 *   - dashboard.php のインラインCSSを外部化し .inc-dashboard スコープに集約
 *   - .btn-mode の重複定義を解消（既存=ベース／ダッシュボード専用=スコープ）
 *   - ユーティリティ（.small-note, .code-inline, .help-note, .nowrap）を統合
 ------------------------------------------ */

/* reset.css と common.css を @import で読み込み */
@import url("./reset.css");
@import url("./common.css");

/* テーマ変数（管理者：白×グリーン） */
:root{
  --sys-green: #16a34a;
  --sys-green-bg: #d9fae5;
  --sys-green-600: #16a34a;
  --sys-green-700: #15803d;
  --sys-green-50: #f0fdf4;
  --sys-border: #e5e7eb;
  --sys-text: #0f172a;
  --sys-muted: #64748b;
  --sys-bg: #ffffff;
  --sys-card: #ffffff;
  --sys-shadow: 0 10px 30px rgba(0,0,0,.05);
}

/* 見出しサイズ */
h1{ font-size: 2.2rem !important; margin-bottom: .8em; }
h2{ font-size: 2.0rem !important; margin: 1.2em 0 .6em; }
h3{ font-size: 1.8rem !important; margin: 1.0em 0 .5em; }

/* 共通ボックスモデル調整 */
main, div p, input, button{ box-sizing: border-box; }

/* =========================================================
 * ログイン画面（既存）
 * ========================================================= */
main.user-login__main,
main.container.verify{
  width: 100%;
  margin: 100px auto 30px;
}
main.user-login__main .bar7,
main.container .bar7{
  background-color: #EEF;
  border-left: 5px solid #66F !important;
  border-right: 5px solid #66F !important;
  text-align: center !important;
  font-size: 2.4rem;
}

/* =========================================================
 * 2列レイアウト（既存）
 * ========================================================= */
.login{
  width: 100%;
  margin: 0 auto 20px;
  display: flex;
  flex-wrap: nowrap;
}
.login > div{
  width: calc(100%/2);
  padding: 7px;
  border: 1px solid #CCC;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* textarea＋補足 small を縦並び（既存修正） */
.login > div textarea{
  flex: 1 1 100%;
  width: 100%;
  min-height: 8em;
  text-align: left;
}
.login > div small.small-note{
  display: block;
  flex: 0 0 100%;
  width: 100%;
  margin-top: 6px;
  text-align: left;
  color: var(--sys-muted);
}
/* 任意の補足テキスト（見やすさ） */
.login > div code,
.login > div small{ font-size: inherit; }
.login > div code{ color: #F66; font-weight: bold; }

/* monospace 入力の可読性 */
.mono,
textarea.mono,
input.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1.3rem;
  line-height: 1.6;
  letter-spacing: .01em;
}

/* =========================================================
 * textarea＋補足（縦並び専用）— 既存
 * ========================================================= */
.login-vertical{
  width: 100%;
  margin: 0 auto 20px;
  display: flex;
  flex-wrap: nowrap;
}
.login-vertical > div{
  width: calc(100%/2);
  padding: 7px;
  border: 1px solid #CCC;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
}
.login-vertical > div textarea{
  flex: 0 0 auto;
  width: 100%;
  min-height: 10em;
  resize: vertical;
}
.login-vertical > div small,
.login-vertical > div .small-note{
  width: 100%;
  margin-top: 6px;
  text-align: left;
  color: var(--sys-muted);
  line-height: 1.5;
}
.login-vertical > div code,
.login-vertical > div small{ font-size: 1.4rem; }
.login-vertical > div code { color: #F66; font-weight: bold; }

/* レイアウト */
body.admin .inner{ max-width: 1200px; margin: 70px auto; }
main.container{ width: 100%; margin: 30px auto; }

/* =========================================================
 * ダッシュボード共通（外部化／.inc-dashboard スコープ）
 * ========================================================= */
body.inc-dashboard-v2{
  background: var(--sys-bg);
  color: var(--sys-text);
}
.sys-main{
  max-width: 1200px;
  margin: 24px auto 120px;
  padding: 0 16px;
}

/* ユーティリティ（外部化） */
.inc-dashboard .small-note{ font-size: 1.2rem; color:#555; }
.inc-dashboard .code-inline{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background:#f3f4f6;
  padding:2px 6px;
  border-radius:6px;
}
.inc-dashboard .help-note{ display:block; margin-top:6px; line-height:1.6; }
.inc-dashboard .nowrap{ white-space: nowrap; }

/* ヒーロー */
.hero{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--sys-border);
  border-radius: 16px;
  background: var(--sys-card);
  box-shadow: var(--sys-shadow);
  margin: 10px 0 24px;
}
@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
}
.hero h1{
  font-size: clamp(2.0rem, 1.6rem + 1vw, 2.6rem);
  margin-bottom: 8px;
}
.hero p{ color: var(--sys-muted); font-size: 1.4rem; }
.hero .kpis{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.hero .kpi{
  border: 1px solid var(--sys-border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.hero .kpi .label{ color: var(--sys-muted); font-size: 1.2rem; }
.hero .kpi .value{ font-weight: 800; font-size: 2rem; color: #111; }

/* セクション共通 */
.section{ margin: 24px 0; }
.section-title{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 12px;
}
.section-title h2{
  font-size: clamp(1.8rem, 1.3rem + .6vw, 2.2rem);
  color: #111;
  font-weight: 800;
  letter-spacing: .01em;
}
.section-title .hint{ color: var(--sys-muted); font-size: 1.3rem; }

/* カード */
.card{
  border: 1px solid var(--sys-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--sys-shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover{
  border-color: var(--sys-green-600);
  box-shadow: 0 12px 34px rgba(22,163,74,.12);
  transform: translateY(-2px);
}
.card h3{ font-weight: 800; font-size: 1.8rem; }
.card p{ color: var(--sys-muted); font-size: 1.3rem; }
.card .actions{
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.card .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  border: 1px solid var(--sys-border);
  background: #fff;
  color: #111;
}
.card .btn.primary{
  background: var(--sys-green-600);
  border-color: var(--sys-green-600);
  color: #fff;
}
.card .btn.primary:hover{
  background: var(--sys-green-700);
  border-color: var(--sys-green-700);
}
.card .btn.ghost:hover{
  border-color: var(--sys-green-600);
  color: var(--sys-green-700);
}

/* 既存フォームの外観をカードに寄せる（共通） */
.box{
  border: 1px solid var(--sys-border) !important;
  border-radius: 16px;
  background: #fff !important;
  box-shadow: var(--sys-shadow);
  padding: 16px !important;
  margin: 18px 0 !important;
}
.bar8{ background: #fff0f0; border-left: 5px solid #f97373; }

/* ================= ダッシュボード専用ボタン =================
   既存の .btn-mode（後述）と衝突しないようスコープ化。
   ＝ dashboard では“緑×丸み”の新UI、他画面は従来UIを維持。 */
.inc-dashboard .btn-mode{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 800;
  background: var(--sys-green-600);
  color: #fff;
  border: 1px solid var(--sys-green-600);
  transition: background .2s ease, transform .06s ease;
  min-width: 120px;
}
.inc-dashboard .btn-mode:hover{
  background: var(--sys-green-700);
  transform: translateY(-1px);
}

/* トグルのチェック色（補強） */
.box .toggle-item input[type="checkbox"]:checked + .toggle-label,
.box .toggle-item input[type="radio"]:checked + .toggle-label.on{
  background: var(--sys-green-600) !important;
  color: #fff !important;
  border-color: var(--sys-green-600) !important;
}
.box .toggle-item input[type="radio"]:not(:checked) + .toggle-label.off{
  background: #f3f4f6;
  color: #111;
  border-color: #e5e7eb;
}

/* 固定フッターツールバー（通常フロー） */
.sys-footer{
  background: #fff;
  border-top: 1px solid var(--sys-border);
  box-shadow: 0 -10px 20px rgba(0,0,0,.05);
}
.sys-footer-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* =========================================================
 * 通知・リスト（既存）
 * ========================================================= */
.row{ margin: 10px 0; }
label{ display: inline-block; min-width: 180px; }
input[type="text"],
input[type="email"],
input[type="password"]{
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 260px;
}
.alert{
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
}
.alert.error{
  background: #ffecec;
  color: #b50000;
  border: 1px solid #f3c0c0;
}
.alert.info{
  background: #eef7ff;
  color: #074a8b;
  border: 1px solid #bcdcff;
}
.list{ /*border: 1px solid #ddd;*/ border-radius: 6px; }
.list-head,
.list-row{
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr;
  padding: 0;
  border-bottom: 1px solid #eee;
}
.list-head{ font-weight: bold; background: #f0f0f0; }
.col{ padding: 2px 6px; }
.col-page{ grid-column: 1/span 1; }
.col-en{ grid-column: 2/span 1; }
.col-id{ grid-column: 1/span 1; }
.col-user{ grid-column: 2/span 1; }
.col-mail{ grid-column: 3/span 1; }
.col-act{ grid-column: 4/span 1; }

/* =========================================================
 * トグル（既存）
 * ========================================================= */
.toggle{ margin: 8px 0; }
.toggle-item{ display: inline-flex; align-items: center; gap: 10px; }
.toggle-item input[type="radio"],
.toggle-item input[type="checkbox"]{
  transform: scale(1.1);
  cursor: pointer;
}
.toggle-label{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid #999;
  background: #ccc;
  color: #000;
  cursor: pointer;
  text-align: center;
}

/* 個別メンテ：ON=青 / OFF=赤（既存強調） */
.toggle-item input[type="radio"]:checked + .toggle-label.on{
  border-color: #0056b3 !important;
  background: #007BFF !important;
  color: #fff !important;
}
.toggle-item input[type="radio"]:checked + .toggle-label.off{
  border-color: #b52b27 !important;
  background: #d9534f !important;
  color: #fff !important;
}

/* サンプル強制退出（ラベル／保存ボタン連動） */
.toggle-item .toggle-label.fe{
  border-color: #999;
  background: #ccc;
  color: #333;
}
.toggle-item input[name="force_exit"]:checked + .toggle-label.fe{
  border-color: #3c8c40;
  background: #4CAF50;
  color: #fff;
}
form .btn-force-exit{
  padding: 8px 16px;
  border: 1px solid #999;
  background: #ccc;
  color: #333;
}
form input[name="force_exit"]:checked ~ .row .btn-force-exit{
  border-color: #3c8c40;
  background: #4CAF50;
  color: #fff;
}

/* 個別メンテ行用ラベル幅（既存） */
.list-mente .toggle-label{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid #999;
  background: #ccc;
  color: #000;
  cursor: pointer;
  text-align: center;
  max-width: 100px;
  min-width: 60px;
  width: 80px;
}

/* チェックテーブル（既存） */
.ck-tbl{
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
}
.ck-tbl > div{
  width: calc(100%/2);
  padding: 7px;
  border: 1px solid #CCC;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: auto;
}

/* =========================================================
 * 保存ボタン（既存の標準UI）
 * ここを“ベース”として残し、ダッシュボードは .inc-dashboard .btn-mode で上書き
 * ========================================================= */
.btn-mode{
  display: block;
  width: 100px;
  text-align: center;
  height: 39.4px;
  line-height: 25.4px;
  background: #028449;
  color: #fff;
  border: 1px solid #015a32;
  border-radius: 12px;
}
.btn-mode:hover{ background: #F90; border-color: #F30; }

/* =========================================================
 * ユーザー用ダッシュボード（既存）
 * ========================================================= */
.kpi{
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
}
.kpi > div{
  width: calc(100%/2);
  padding: 7px;
  border: 1px solid #CCC;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* =========================================================
 * 解析（dashboard のみ使用する追加UI）
 * ========================================================= */
.inc-dashboard .sid-form{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
  align-items:center;
  max-width:560px;
}
.inc-dashboard .sid-form input[type="text"]{
  padding:6px; border:1px solid #ccc; border-radius:6px; min-width:200px;
}
.inc-dashboard .sid-form .btn-mode{ min-width:140px; }
.inc-dashboard .sid-note{ margin-top:6px; color:#64748b; font-size:1.3rem; }

.inc-dashboard .analyse-html .grid{
  display:grid; grid-template-columns: 1fr; gap:12px;
}
.inc-dashboard .analyse-html .list-head,
.inc-dashboard .analyse-html .list-row{
  display:grid;
  grid-template-columns: 1.6fr 0.9fr 0.9fr;
  gap:0;
  border-bottom:1px solid #e5e7eb;
}
.inc-dashboard .analyse-html .list-head{ background:#f8fafc; font-weight:700; }
.inc-dashboard .analyse-html .col{
  padding:8px;
  border-right:1px solid #e5e7eb;
}
.inc-dashboard .analyse-html .col:last-child{ border-right:none; }
.inc-dashboard .badge-ok{ color:#16a34a; font-weight:800; }
.inc-dashboard .badge-ng{ color:#dc2626; font-weight:800; }
.inc-dashboard .badge-miss{ color:#6b7280; font-weight:700; }
.inc-dashboard .analyse-html textarea{ width:100%; min-height:100px; }