/*

 */

/* ブラウザ既定のUAスタイルシートがbodyに余白(margin)を入れるため、html/bodyとの隙間を消す */
body {
  margin: 0;
  font-family: sans-serif;
  color: #1a1a1a;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.25rem;
}

/* マスタ管理画面の新規/編集フォーム共通スタイル（docs/steering/screen_design/mocks/sp1_input.htmlの入力欄イメージを踏襲） */
.field input[type=text],
.field input[type=email],
.field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  background: #fff;
}

.actions {
  margin-top: 1rem;
}

.registrations-table {
  border-collapse: collapse;
  width: 100%;
}

.registrations-table th,
.registrations-table td {
  border: 1px solid #ccc;
  padding: 0.5rem;
}

.registrations-table th {
  background: #f5f5f5;
}

.registration-detail {
  max-width: 32rem;
}

.registration-detail dt {
  font-weight: bold;
  margin-top: 0.75rem;
}

.registration-detail dd {
  margin-left: 0;
}

.error {
  color: #c00;
}

.qr-image {
  display: block;
  margin: 1rem 0;
}

.layout-with-sidebar {
  display: flex;
  gap: 2rem;
  max-width: 960px;
}

.sidebar {
  flex: 0 0 180px;
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
}

.sidebar li {
  margin-bottom: 0.5rem;
}

.main-content {
  flex: 1;
}

.qr-menu-form .field {
  margin-bottom: 1rem;
}

.qr-menu-form label {
  display: block;
  margin-bottom: 0.25rem;
}

.qr-menu-form select {
  min-width: 200px;
  padding: 0.25rem;
}

.btn-primary {
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.generated-url {
  word-break: break-all;
  background: #f5f5f5;
  padding: 0.75rem;
  margin: 1rem 0;
}

.btn-back {
  display: inline-block;
  margin-top: 1rem;
}

/* 認証ナビバー */
.auth-nav {
  background: #333;
  color: white;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.auth-nav-name {
  font-size: 0.9rem;
}

.btn-logout {
  background: transparent;
  color: white;
  border: 1px solid white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* EZ Sign */
.ezsign-page {
  max-width: 480px;
  margin: 2rem auto;
  padding: 0 1rem;
  font-family: sans-serif;
}

.ezsign-page h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.ezsign-page h2 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
}

.ezsign-preview {
  margin: 1rem 0;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 8px;
}

.ezsign-preview-img {
  max-width: 100%;
  height: auto;
  display: block;
}

.ezsign-error {
  color: #c00;
  margin: 1rem 0;
}

.ezsign-actions {
  margin: 1.5rem 0;
}

.ezsign-download-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
}

.ezsign-download-btn:hover {
  background: #555;
}

.ezsign-note {
  font-size: 0.875rem;
  color: #666;
  margin-top: 1rem;
}

/* ログインフォーム */
.login-container {
  max-width: 400px;
  margin: 5rem auto;
  padding: 0 1rem;
}

.login-container h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.login-field {
  margin-bottom: 1rem;
}

.login-field label {
  display: block;
  margin-bottom: 0.25rem;
}

.login-field input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.btn-login {
  width: 100%;
  padding: 0.625rem;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* SP: スマホ画面共通シェル（POCKET-61, docs/steering/screen_design/mocks/sp1_input.html 準拠） */
.mobile-shell {
  max-width: 420px;
  margin: 2rem auto;
  padding: 0 1.25rem 2.5rem;
}

.mobile-shell h1 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

.mobile-shell .field input[type=text] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.mobile-shell .field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  background: #fff;
}

.mobile-shell .hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.3rem;
}

.field-error {
  color: #c00;
  background: #fdecea;
  border: 1px solid #f5c2bd;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.btn-lg {
  display: block;
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  margin-top: 0.85rem;
  box-sizing: border-box;
  border: none;
}

.btn-lg.primary {
  background: #1a1a1a;
  color: #fff;
}

.btn-lg.primary:active {
  background: #444;
}

.btn-lg.secondary {
  background: #fff;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
}

.btn-lg.secondary:active {
  background: #f0f0f0;
}

/* SP-2 内容確認画面（POCKET-55, docs/steering/screen_design/mocks/sp2_confirm.html 準拠） */
.btn-back-mobile {
  display: inline-block;
  background: none;
  border: none;
  color: #1a1a1a;
  font-size: 1rem;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.stack-block>div {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.confirm-highlight {
  background: #fff;
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}

.confirm-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.confirm-row+.confirm-row {
  margin-top: 0.5rem;
}

.confirm-label {
  font-size: 0.8rem;
  color: #666;
  flex: 0 0 3.5rem;
}

.confirm-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.thumb-lg {
  background: #f5f5f5;
  border: 1px dashed #ccc;
  border-radius: 8px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  margin-bottom: 0.75rem;
  text-align: center;
  padding: 0.75rem 1rem;
  overflow: hidden;
}

.thumb-lg img {
  max-width: 100%;
  height: auto;
  display: block;
}

.btn-row {
  display: flex;
  gap: 0.75rem;
}

.btn-row .btn-lg {
  margin-top: 0;
  flex: 1;
}

/* button_to は内部で<form>を生成し、.btn-rowの直接の子はそのformになる。
   formにもflex:1を効かせないと中の.btn-lgが100%幅でもform自体が縮んでしまい、
   2分割で画面いっぱいにならない（POCKET-55フォローアップ）。 */
.btn-row form {
  flex: 1;
  margin: 0;
}

.toast-success {
  background: #eafaf0;
  border: 1px solid #b7e4c7;
  color: #1e6b3c;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.toast-info {
  background: #fff4e5;
  border: 1px solid #ffcc80;
  color: #8a5000;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* フロント入力チェック（インライン/サマリーエラー、POCKET-61 セルフレビュー対応） */
/* エラーの色は docs/steering/screen_design/screen_design.html 7節のカラールール（#b3261e）に合わせる */
/* 券種（select）は×アイコンを置かず赤枠のみ。従業員番号・店番（テキスト入力）は×アイコン分の余白を確保する */
.mobile-shell .field-input-wrap {
  position: relative;
}

.mobile-shell .field-input-wrap input[type=text] {
  padding-right: 2.25rem;
}

.mobile-shell .field-input-wrap.is-invalid input[type=text],
.mobile-shell .field-input-wrap.is-invalid select {
  border-color: #b3261e;
}

.field-invalid-icon {
  display: none;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #b3261e;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  pointer-events: none;
}

.field-input-wrap.is-invalid .field-invalid-icon {
  display: block;
}

.field-inline-error {
  display: none;
  color: #b3261e;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.field-inline-error.show {
  display: block;
}

.form-error-summary {
  color: #b3261e;
  background: #fdecea;
  border: 1px solid #f0b8b3;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* PC: マスタ一覧・CSVアップロード（docs/steering/screen_design/mocks/style.css より移植） */
.upload-card {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  background: #fafafa;
}

.upload-card .title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.upload-card .status-ok {
  font-size: 0.8rem;
  color: #1e6b3c;
  font-weight: 400;
}

.upload-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.upload-row input[type=file] {
  flex: 1;
  min-width: 220px;
}

.btn-mini {
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-mini:active {
  background: #444;
}

.upload-hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.6rem;
}

.btn-new {
  display: inline-block;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 1.2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.data-table th,
.data-table td {
  border: 1px solid #ccc;
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #f5f5f5;
}

.data-table td.col-actions {
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  gap: 0.85rem;
  align-items: center;
}

.link-edit {
  color: #1a4b8c;
  text-decoration: none;
}

.link-delete {
  color: #c00;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.thumb-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.thumb-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 38px;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  border-radius: 4px;
  font-size: 0.65rem;
  color: #999;
  text-align: center;
  overflow: hidden;
}

/* POCKET-56フォローアップ: 券種画像サムネイルは image_processing 未導入のため原寸 <img> をCSSで縮小表示する */
.thumb-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-upload {
  font-size: 0.78rem;
  color: #1a4b8c;
  text-decoration: none;
  white-space: nowrap;
}

.url-cell {
  font-family: monospace;
  font-size: 0.82rem;
  color: #555;
  word-break: break-all;
  max-width: 240px;
}

.filter-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-row input[type=date] {
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* 2カラムレイアウト（サイドバーをカード状に囲むのではなく、画面高さいっぱいに伸びる列として扱う。
   上記16-20行目の旧ルールをCSSカスケードで上書きするため末尾に追記） */
.layout-with-sidebar {
  max-width: none;
  margin: 0;
  gap: 0;
  align-items: stretch;
  min-height: calc(100vh - 53px);
}

.sidebar {
  flex: 0 0 220px;
  background: #fafafa;
  border-right: 1px solid #e4e4e4;
  padding: 1.5rem 1rem;
}

.sidebar h2 {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 0.75rem;
  padding: 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar ul {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar li {
  margin-bottom: 0;
}

.sidebar li a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9rem;
}

.sidebar li a:hover {
  background: #ececec;
}

.sidebar li.current a {
  background: #1a1a1a;
  color: #fff;
  font-weight: 600;
}

.main-content {
  padding: 1.5rem 2.5rem;
}

/* 新規登録・編集フォーム画面のみ余白を広くする */
.main-content.form-page {
  padding: 1.5rem 6rem;
}

/* 削除確認モーダル（button_to の data-confirm を window.confirm ではなくモーダルで表示する。application.js参照） */
.confirm-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirm-modal-overlay.show {
  display: flex;
}

.confirm-modal {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.confirm-modal p {
  margin: 0.5rem 0 4rem 0;
  font-size: 1rem;
  text-align: center;
}

.confirm-modal .btn-row {
  margin: 0;
}

.confirm-modal-btn {
  display: block;
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  margin-top: 0.85rem;
  box-sizing: border-box;
  border: none;
}

.confirm-modal-btn.primary {
  background: #1a1a1a;
  color: #fff;
}

.confirm-modal-btn.secondary {
  background: #fff;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
}

.confirm-modal-btn.primary:active {
  background: #444;
}

.confirm-modal-btn.secondary:active {
  background: #f0f0f0;
}
