/* 共通：ヘッダー・ログイン・ボタン・お知らせ・一覧表・フォーム・翻訳ページ
   ★見た目の設定は css/ の番号順に読み込む（base.html）。後の番号ほど優先される。
   ★2026-10-09 に style.css を順番を変えずに切り分けたもの（つなぐと元と同じ）。 */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: #f4f6f8;
  color: #2b2b2b;
}

/* ヘッダー（上のバー）と右上の「⚙ 設定」一覧は css/shared_header.css（3ツール共通・2026-10-10）。
   ここには書かない（書くと共通の見た目とずれる） */

.container { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }

/* 2ペイン画面は広く使う。上下の余白も詰めて、そのぶんを会話の表示に回す
   （この指定はメッセージ一覧画面だけに効く。他の画面の余白は従来どおり） */
.container:has(.split) { max-width: 1500px; padding: 12px 20px; }

/* ログイン・初回設定カード */
.auth-card {
  max-width: 380px;
  margin: 80px auto 0;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  padding: 32px 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-card h1 { margin: 0 0 12px; font-size: 20px; text-align: center; }

.auth-note { font-size: 13px; color: #5a6573; text-align: center; margin-bottom: 20px; }

.auth-card label {
  display: block;
  font-size: 13px;
  color: #44505e;
  margin-bottom: 14px;
}

.auth-card input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  font-size: 14px;
  border: 1px solid #c4ccd6;
  border-radius: 6px;
}

.auth-card input:focus { outline: 2px solid #3f72af; border-color: #3f72af; }

.btn-primary {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  background: #2d6cdf;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-primary:hover { background: #2459bd; }

.btn-secondary {
  padding: 8px 16px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #c4ccd6;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary:disabled, select:disabled { color: #9aa4b0; cursor: not-allowed; background: #eef1f4; }

/* お知らせ・エラー表示 */
.alert { padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c2; }
.alert-info { background: #e8f1fd; color: #1d4f91; border: 1px solid #c3d9f5; }

/* メッセージ一覧画面 */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 { font-size: 20px; margin: 0; }
/* 見出しを置かないページ（現在地は上のメニューで分かる）。ボタンだけを右に寄せる */
.page-header-right { justify-content: flex-end; }

.toolbar { display: flex; gap: 10px; }
.toolbar select { padding: 8px 10px; font-size: 13px; border: 1px solid #c4ccd6; border-radius: 6px; }

.empty-state {
  background: #fff;
  border: 1px dashed #c4ccd6;
  border-radius: 10px;
  padding: 60px 20px;
  text-align: center;
  color: #5a6573;
}

.empty-state p { margin: 4px 0; }
.empty-sub { font-size: 13px; color: #8a94a0; }

/* 絞り込みバー */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.filter-bar select, .filter-bar input[type="text"] {
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #c4ccd6;
  border-radius: 6px;
  background: #fff;
}

.filter-bar input[type="text"] { width: 320px; }

/* 一覧テーブル */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}

.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eef1f4;
  vertical-align: middle;
}

.data-table th { background: #f0f3f7; color: #44505e; font-size: 12px; }
.data-table tbody tr:hover { background: #f7fafd; }

.cell-title { font-weight: bold; }
.cell-preview { color: #6a7480; max-width: 360px; }
.col-num { text-align: center; width: 70px; }
.col-actions { width: 130px; white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  background: #e8f1fd;
  color: #1d4f91;
  border-radius: 10px;
  white-space: nowrap;
}

/* ボタン追加分 */
.btn-link {
  display: inline-block;
  width: auto;
  text-decoration: none;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
}

.btn-small { padding: 4px 10px; font-size: 12px; }

.btn-danger {
  padding: 4px 10px;
  font-size: 12px;
  color: #b3261e;
  background: #fff;
  border: 1px solid #e7b9b5;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger:hover { background: #fdecea; }

.btn-plain { font-size: 13px; color: #3f72af; text-decoration: none; padding: 8px 4px; }

.inline-form { display: inline; margin-left: 4px; }

/* 追加・編集フォーム */
.edit-form {
  max-width: 640px;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  padding: 24px;
}

.edit-form label {
  display: block;
  font-size: 13px;
  color: #44505e;
  margin-bottom: 16px;
}

.edit-form input[type="text"], .edit-form select, .edit-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  font-size: 14px;
  border: 1px solid #c4ccd6;
  border-radius: 6px;
  font-family: inherit;
}

.edit-form textarea { resize: vertical; }

.edit-form input:focus, .edit-form select:focus, .edit-form textarea:focus {
  outline: 2px solid #3f72af;
  border-color: #3f72af;
}

.required {
  font-size: 11px;
  color: #b3261e;
  background: #fdecea;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.form-actions { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
.btn-fit { width: auto; padding: 10px 28px; }

/* 翻訳画面 */
.translate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .translate-grid { grid-template-columns: 1fr; }
}

.translate-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  padding: 20px;
}

.translate-card h2 { font-size: 15px; margin: 0 0 14px; color: #1f3a5f; }

.translate-card label {
  display: block;
  font-size: 12px;
  color: #5a6573;
  margin: 10px 0 4px;
}

.translate-card textarea {
  width: 100%;
  padding: 9px 10px;
  font-size: 14px;
  border: 1px solid #c4ccd6;
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
}

.translate-card textarea[readonly] { background: #f7f9fb; }

.translate-card textarea:focus { outline: 2px solid #3f72af; border-color: #3f72af; }

.translate-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}

.notice { font-size: 12px; color: #5a6573; }
.notice-ok { color: #1a7f37; }
.notice-error { color: #b3261e; }

/* ファイルを選ぶボタン（返信の画像添付・テンプレートの取り込み）。
   ブラウザ標準の灰色の古い見た目をやめ、ほかの小さいボタン（.btn-secondary.btn-small）とそろえる（2026-10-09） */
input[type="file"]::file-selector-button {
  padding: 4px 10px;
  margin-right: 8px;
  font: inherit;
  font-size: 12px;
  color: inherit;
  background: #fff;
  border: 1px solid #c4ccd6;
  border-radius: 6px;
  cursor: pointer;
}

