@import url("reset.css");
@import url(https://fonts.googleapis.com/css?family=Exo:100,200,400);

/* common */
:root {
  /* プライマリーカラー */
  --primary-dark: #333333;
  --primary-main: #F5F5F5;
  --primary-light: #F0F0F0;

  /* アクセントカラー */
  --accent-blue: #0088CC;
  --accent-green: #2ECC71;
  --accent-red: #FF6B6B;

  /* テキストカラー */
  --text-primary: #333333;
  --text-secondary: #757575;
  --text-light: #FFFFFF;

  /* 背景色 */
  --bg-main: #F5F5F5;
  --bg-card: #FFFFFF;

  /* ボーダー色 */
  --border-color: #E0E0E0;

  /* シャドウ */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.12);

  /* ボタンカラー */
  --btn-primary: #0088CC;
  --btn-primary-hover: #0077B3;

  --btn-secondary: #2ECC71;
  --btn-secondary-hover: #27AE60;

  --btn-danger: #FF6B6B;
  --btn-danger-hover: #FF5252;

  /* ホバー時の背景色 */
  --hover-bg: #FFE8E6;
}


/*====================================
  基本スタイル
====================================*/
body {
  font-family: 'メイリオ', 'Meiryo', 'Hiragino Sans', 'ヒラギノ角ゴシック', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-main);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  letter-spacing: 0.05em;
}

/* スムーズスクロール */
html {
  scroll-behavior: smooth;
}

/* 基本レイアウト */
#wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

#side-nav {
  width: 250px;
  min-width: 250px;
  background-color: var(--bg-card);
  color: var(--text-primary);
  padding: 10px;
  height: 100vh;
  position: fixed;
  overflow-y: auto;
}

#content {
  padding: 20px;
  background: var(--bg-main);
  margin-left: 250px;
  min-height: 100vh;
  /* width: 1000px; */
  max-width: calc(100% - 250px);
  overflow-x: hidden;
}

.section-title {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-blue);
}

.content-area {
  padding: 20px 0;
}

.headinfo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-card);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.staff-info {
  font-size: 14px;
  color: var(--text-primary);
}

/* 選択時のハイライトカラーをカスタマイズする場合 */
::selection {
  background-color: var(--accent-blue);
  color: var(--text-light);
}


/* 日付入力フィールド */
.form-table input[type="date"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

.form-table input[type="date"]:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(28, 168, 215, 0.2);
}


/*====================================
  ログイン画面用スタイル
====================================*/
#index {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: var(--bg-main);
}

#index #inwrap {
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

#index #panel {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 30px;
  animation: fadeIn 0.3s ease-out;  /* フェードインアニメーション追加 */
}

#index .login-table {
  width: 100%;
  border-collapse: collapse;
}

#index .system-title {
  padding: 12px;
  text-align: center;
  font-size: 22px;
  padding: 20px 12px;
  font-weight: bold;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-blue);  /* タイトル下線追加 */
  margin-bottom: 15px;
}

#index .message-area {
  padding: 12px;
  text-align: center;
  min-height: 20px;  /* メッセージがない時の高さ確保 */
}

#index th {
  padding: 12px;
  text-align: left;
  color: var(--text-primary);
  font-weight: 500;  /* フォントウェイト調整 */
}

#index td {
  padding: 12px;
}

#index .login-input {
  width: 100%;
  padding: 12px;  /* パディング増加 */
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;  /* トランジション追加 */
}

#index .login-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(28, 168, 215, 0.15);  /* フォーカス時の影を微調整 */
  transform: translateY(-1px);  /* 微細な動き追加 */
}

#index .button-area {
  display: block;
  text-align: center;
  padding: 20px 12px 12px;
  margin-top: 10px;
}

#index #loginbtn {
  width: auto;
  min-width: 200px;
  padding: 14px 50px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-block;
}

#index #loginbtn:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);  /* ホバー時の浮き上がり効果 */
  box-shadow: var(--shadow-sm);
}

#index #loginbtn:active {
  transform: translateY(0);  /* クリック時の沈み込み効果 */
}

/* エラーメッセージのスタイル */
#index .error {
  background: rgba(254, 149, 144, 0.1);
  color: var(--accent-red);
  padding: 12px;
  border-radius: 4px;
  text-align: center;
  margin: 10px 0;
  border: 1px solid rgba(254, 149, 144, 0.2);
  font-weight: 500;
}

/* フェードインアニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 入力欄のプレースホルダーのスタイル */
#index .login-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* オートフィル時の背景色調整 */
#index .login-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset;
  -webkit-text-fill-color: var(--text-primary);
}

/* フォーカス時のアウトラインを完全に消す（Firefoxなど） */
#index .login-input::-moz-focus-inner {
  border: 0;
}


/*====================================
  ナビゲーション & サイドメニュー
====================================*/

/* ナビゲーション関連のスタイル */
.nav-header {
  padding: 0px 0;
}

.nav-header h1 {
  font-size: 18px;
  color: var(--accent-blue);
  /* margin-bottom: 15px; */
  padding: 10px 0;
  text-align: center;
}


/* ログインユーザー情報 */
.login-info {
  font-size: 11px;
  color: var(--text-primary);
  opacity: 0.8;
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

/* メニューセクション */
.menu-section {
  /* margin: 10px 0; */
  padding-bottom: 5px;
}

.menu-title {
  font-size: 16px;
  color: var(--accent-blue);
  margin: 5px 0 10px;
  padding-left: 5px;
  border-left: 3px solid var(--accent-blue);
  font-weight: bold;
  text-transform: uppercase;
}

/* メニューリスト */
.side-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-menu ul li {
  margin: 0;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
}


.side-menu ul li a {
  display: block;
  padding: 8px 15px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.side-menu ul li a:hover {
  background: var(--primary-light);
}

.side-menu ul li a.active {
  background: var(--accent-green);
  color: var(--text-light);
}

/* 自動振り分け作成ボタン */
.distribution-create-button {
  display: block;
  background: var(--btn-primary);
  color: var(--text-light) !important;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  padding: 15px !important;
  margin: 5px 0 10px 0 !important;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.distribution-create-button:hover {
  background: var(--btn-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ログアウト */
.logout-section {
  margin-top: 30px;
  padding: 15px 0;
}

.logout-button {
  display: block;
  background: var(--primary-light);
  color: var(--text-primary);
  text-align: center;
  padding: 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.logout-button:hover {
  background: var(--accent-red);
  color: var(--text-light);
}


/*====================================
  コンテンツヘッダー
====================================*/

/* ヘッダー共通部分のスタイル */
#commonHeader {
  width: 100%;
  padding: 15px 20px;
  background: var(--bg-card);  /* 白背景維持 */
  border-radius: 4px;
  box-shadow: var(--shadow-sm);  /* 共通の変数維持 */
}

#commonHeader ul {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 0;
  margin: 0;
}

#commonHeader ul li {
  display: flex;
  align-items: center;
  color: var(--text-primary);  /* 黒系文字色に変更 */
  font-size: 14px;
}

#commonHeader ul li span {
  color: var(--accent-blue);  /* 数値を青色に変更 */
  font-weight: bold;
  font-size: 16px;
  margin-left: 8px;
}

.headinfo {
  margin-bottom: 20px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.content-header {
  margin-bottom: 20px;
}

.content-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);  /* 黒系文字色維持 */
}

/*====================================
  search_box.php 共通検索ボックス
====================================*/
.search-box {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

/* 検索フレックスコンテナ */
.search-flex {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.search-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-item label {
  font-weight: bold;
  color: var(--text-primary);
  font-size: 14px;
}

/* セレクトボックス */
.search-item select {
  width: 160px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
}

/* キーワード入力欄 */
.search-item.keyword {
  flex-grow: 1;
}

.search-item input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
}

/* フォーカス時のスタイル */
.search-item select:focus,
.search-item input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(28, 168, 215, 0.2);
}

/* ボタンエリア */
.button-area {
  display: flex;
  gap: 10px;
}

/* 検索ボタン */
.search-btn {
  padding: 8px 24px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-btn:hover {
  background: var(--btn-primary-hover);
}

/* クリアボタン */
.clear-btn {
  padding: 8px 24px;
  background: var(--primary-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: var(--hover-bg);
  color: var(--accent-red);
}

/* 年月選択部分のスタイル */
.date-select {
  display: flex;
  gap: 10px;
}

.date-select select {
  width: 100px;  /* 幅を調整 */
}








/*====================================
  top.php ダッシュボード
====================================*/
/* セクション設定 */
.dashboard-section {
  margin-bottom: 30px;
}



/* 情報ボックス */
.info-box {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}

.box-title {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* カウント表示 */
.count {
  background: var(--accent-blue);
  color: var(--text-light);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 14px;
}


/* テーブルスタイル
-----------------*/
.data-table {
  width: 100%;
  overflow-x: auto;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--primary-light);
  padding: 12px;
  /* text-align: left; */
  font-weight: bold;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.data-table td {
  text-align: right;
  padding: 12px;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* 偶数行の背景色 */
.data-table tr:nth-child(even) {
  background: var(--bg-main);
}

/* ホバー時の背景色 */
.data-table tr:hover td {
  background: var(--hover-bg);
}


/* ステータス表示用スタイル
-----------------*/
/* 増減率表示 */
.data-table td.positive {
  color: var(--accent-green);
}

.data-table td.negative {
  color: var(--accent-red);
}

/* 警告表示 */
.data-table td.warning {
  color: var(--accent-red);
  font-weight: bold;
}

/* レスポンシブ対応
-----------------*/
.data-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table td.no-data {
  text-align: center;
}

/*====================================
  store_list.php 契約店舗一覧
====================================*/
.page-title {
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-blue);
}

.list-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

/* ヘッダー */
.list-table thead th {
  background: var(--primary-light);
  padding: 12px;
  text-align: left;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 2px solid var(--border-color);
}

/* データセル */
.list-table tbody td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

/* 列幅の調整 */
.id-column { width: 100px; }
.area-column { width: 80px; }
.name-column {
  min-width: 200px;
  max-width: 300px;
}
.manager-column { width: 100px; }
.plan-column { width: 100px; }
/* .date-column { width: 100px; } */
.price-column { width: 100px; }
.action-column { width: 80px; }

/* 店舗名のスタイル */
.store-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

/* 編集ボタン */
.edit-btn {
  padding: 6px 12px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.edit-btn:hover {
  background: var(--btn-primary-hover);
}



/* ゼブラストライプ */
.list-table tbody tr:nth-child(even) {
  background: var(--primary-light);
}

/* 行のホバー効果 */
.list-table tbody tr:hover,
.list-table tbody tr:nth-child(even):hover {
  background: var(--hover-bg);
}

/* レスポンシブ対応 */
@media screen and (max-width: 1400px) {
  .list-table {
    font-size: 13px;
  }

  .list-table td,
  .list-table th {
    padding: 8px;
  }
}


.product_list .form-section{
  padding: 0 20px;
}


/*====================================
  entry.php 契約店舗登録
====================================*/
.entry-form {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

/* セクションスタイル */
.form-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h4 {
  font-size: 16px;
  color: var(--accent-blue);
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* 商品ベースセクション */
.product-base-section {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.product-base-section .section-header {
  background: var(--primary-light);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
}

.product-base-section .section-header h4 {
  margin: 0;
  border: none;
  padding: 0;
  font-size: 16px;
  color: var(--text-primary);
}

.product-base-section .remove-base-btn {
  padding: 5px 12px;
  background: var(--accent-red);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.product-base-section .remove-base-btn:hover {
  background: var(--btn-danger-hover);
}

/* テーブルスタイル */
.form-table {
  width: 100%;
  border-collapse: collapse;
}

.form-table th {
  width: 180px;
  padding: 12px 15px;
  text-align: left;
  font-weight: bold;
  vertical-align: top;
  white-space: nowrap;
}

.form-table td {
  padding: 12px 15px;
}

/* 必須マークのスタイル */
.required {
  color: var(--accent-red);
  margin-left: 3px;
  font-weight: bold;
}

/* 入力フィールド */
.form-table input[type="text"],
.form-table input[type="tel"],
.form-table input[type="email"],
.form-table input[type="url"],
.form-table input[type="password"],
.form-table select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

/* 入力フィールドの幅調整 */
.form-table input[type="text"].input-sm {
  max-width: 200px;
}

.form-table input[type="text"].input-md {
  max-width: 350px;
}

.form-table input[type="tel"],
.form-table input[type="email"] {
  max-width: 300px;
}

.form-table select {
  max-width: 400px;
}

.form-table input[type="date"] {
  max-width: 180px;
}

.form-table input[type="url"] {
  max-width: 400px;
}

/* 複数入力フィールドのレイアウト */
.multi-input {
  display: flex;
  gap: 20px;
}

.input-group-with-button {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.input-group-with-button .input-group {
  flex: 1;
}

.input-group-with-button .sub-btn {
  margin-top: 0;
  white-space: nowrap;
}


.input-group {
  flex: 1;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

/* ファイルプレビュー */
.file-preview {
  margin-top: 5px;
}

.preview-link {
  display: inline-block;
  margin-bottom: 10px;
}

.preview-img {
  max-width: 200px;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

/* サブボタン（グループ追加など） */
.sub-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--primary-light);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  text-align: center;
  margin-top: 24px;
}

.sub-btn:hover {
  background: var(--hover-bg);
}

/* ボタンエリア */
/* entry.php ボタンエリア */
.entry-button-area {
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  justify-content: center;
  display: flex;
  gap: 15px;
  background: var(--primary-light);
}

/* 契約を作成ボタン（青） */
.entry-submit-btn {
  padding: 12px 50px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.entry-submit-btn:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.entry-submit-btn:active {
  transform: translateY(0);
}

/* リセットボタン（赤） */
.entry-reset-btn {
  padding: 12px 50px;
  background: var(--accent-red);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.entry-reset-btn:hover {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.entry-reset-btn:active {
  transform: translateY(0);
}

/* キャンセルボタン（黄色系） */
.entry-cancel-btn {
  padding: 12px 50px;
  background: #f39c12;
  color: var(--text-light);
  text-decoration: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

.entry-cancel-btn:hover {
  background: #e67e22;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.entry-cancel-btn:active {
  transform: translateY(0);
}

/* ステータス管理セクション */
.product-status-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border-color);
}

.status-section-title {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: var(--text-primary);
  font-weight: bold;
}

.status-current-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.status-label {
  font-weight: bold;
  color: var(--text-secondary);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  background: var(--primary-light);
  color: var(--text-primary);
}

.status-badge.active {
  background: var(--accent-green);
  color: var(--text-light);
}
.status-badge.inactive {
  background: var(--accent-red);
  color: var(--text-light);
}


.status-change-row {
  margin-top: 15px;
}

.status-change-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  font-weight: normal;
}

.status-change-details {
  margin-top: 15px;
  padding: 15px;
  background: var(--primary-light);
  border-radius: 4px;
}

.status-detail-fields {
  margin-top: 15px;
  padding: 15px;
  background: var(--primary-light);
  border-radius: 4px;
}

.status-detail-fields .form-group {
  margin-bottom: 15px;
}

.status-detail-fields .form-group:last-child {
  margin-bottom: 0;
}

/* カスタム料金入力フィールド */
.custom-price-field {
  width: 70px;
  text-align: right;
}

/* フォーカス時のスタイル */
.form-table input:focus,
.form-table select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(28, 168, 215, 0.2);
}

/* チェックボックスのスタイル */
.form-table input[type="checkbox"],
.form-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  cursor: pointer;
  vertical-align: middle;
  accent-color: var(--accent-blue);
}

.form-table label:has(input[type="checkbox"]),
.form-group label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
  gap: 8px;
}

.checkbox-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-area label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-area input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-blue);
}

/* チェックボックス付きラベルのホバー効果 */
.form-group label:has(input[type="checkbox"]):hover,
.checkbox-area label:hover {
  color: var(--accent-blue);
}

/* ノート（説明文）のスタイル */
.note {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: normal;
}

/* ラベル内のノートは横並び */
label.marginTitle .note {
  display: inline;
  margin-left: -5px;
}

/* 独立したノート（改行したい場合） */
.note.block {
  display: block;
  margin-top: 5px;
  margin-left: 0;
}


/* 料金サマリ表示エリア */
.price-summary {
  background: var(--primary-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 15px;
  margin-top: 15px;
}

.price-summary h4 {
  font-size: 14px;
  margin: 0 0 10px 0;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 14px;
}

.price-row span:first-child {
  color: var(--text-secondary);
}

.price-row span:last-child {
  font-weight: bold;
  color: var(--text-primary);
}

.price-row.price-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid var(--border-color);
  font-size: 16px;
}

.price-row.price-total span:last-child {
  color: var(--accent-blue);
  font-size: 18px;
}

/* 契約情報エリア */
.contract-info {
  padding: 15px;
}

/* 現在の契約プラン一覧 */
.current-plans {
  margin-bottom: 20px;
}

.current-plans h4,
.add-plan-section h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-item {
  background: var(--primary-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px;
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.plan-name {
  font-weight: bold;
  color: var(--text-primary);
}

.plan-delete-btn {
  padding: 4px 8px;
  background: var(--accent-red);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.plan-delete-btn:hover {
  background: var(--btn-danger-hover);
}

.plan-details {
  font-size: 13px;
  color: var(--text-secondary);
}

/* プラン追加セクション */
.add-plan-section {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 15px;
}

.plan-action {
  margin-top: 15px;
  text-align: right;
}

.add-plan-btn {
  padding: 8px 20px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.add-plan-btn:hover {
  background: var(--btn-primary-hover);
}




/*====================================
product_list.php 商品一覧
====================================*/
.page-title {
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-blue);
}
/* 操作エリア */
.operation-area {
  margin-bottom: 20px;
}


.product-section {
  margin-bottom: 30px;
}

.product-section .section-title {
  font-size: 18px;
  color: var(--accent-blue);
  margin: 25px 0 15px;
  padding: 8px 12px;
  background: var(--primary-light);
  border-radius: 4px;
  border-left: 4px solid var(--accent-blue);
  border-bottom: none;
}

.product-section:first-of-type .section-title {
  margin-top: 0;
}

.add-btn {
  padding: 8px 20px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.add-btn:hover {
  background: var(--btn-primary-hover);
}

/* テーブル */
.list-table-wrapper {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}

/* ヘッダー */
.list-table thead th {
  background: var(--primary-light);
  padding: 15px;
  text-align: left;
  font-weight: bold;
  border-bottom: 2px solid var(--border-color);
}

/* 列幅の調整 */
.id-column { width: 120px; }
.name-column { width: 150px; }
.price-column { width: 150px; }
.desc-column { min-width: 200px; }
.action-column { width: 100px; }

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: rgba(0, 0, 0, 0.5); */
  z-index: 1000;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 0px;
}

.form-group label {
  display: block;
  margin-bottom: 3px;
  font-weight: bold;
  margin-top: 10px;
  line-height: 1.0;
}

.form-group input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.form-group input[type="tel"],
.form-group input[type="email"] {
  max-width: 300px;
}

.form-group input[type="text"] {
  max-width: 350px;
}

.form-group input[type="number"] {
  max-width: 150px;
  text-align: right;
}

/* 数字入力を右寄せにするクラス */
input[type="number"].number-input-right,
.number-input-right {
  text-align: right;
}

.form-group select {
  max-width: 250px;
}

.form-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.submit-btn {
  padding: 8px 20px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.cancel-btn {
  padding: 8px 20px;
  background: var(--primary-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
}


/* メッセージボックス */
.message-box {
  margin-top: 10px;
  padding: 10px 15px;
  background: var(--accent-green);
  color: var(--text-light);
  border-radius: 4px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*====================================
agency_list.php 代理店一覧
====================================*/
/* 基本構造はproduct_list.phpと同じ */
/* 項目の幅だけ調整 */
.agency_list .id-column { width: 100px; }
.agency_list .code-column { width: 80px; }
.agency_list .name-column { width: 200px; }
.agency_list .tel-column { width: 150px; }
.agency_list .email-column { width: 200px; }
.agency_list .date-column { width: 100px; }
.agency_list .action-column { width: 80px; }

.agency_list .list-table tbody td:nth-child(2) {
  text-align: center;
}


.agency_list .form-section {
  margin-bottom: 20px;
}


.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-row .form-group {
  flex: 1;
}

/* 4カラムレイアウト（代理店名、ID、コード、インボイス） */
.form-row-4 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 15px;
}

/* 3カラムレイアウト（代表者名、電話、メール） */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 0;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-bottom: 0;
}

.form-row-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 15px;
  margin-bottom: 0;
}

.form-help {
  font-size: 0.85em;
  color: #666;
  margin-top: 4px;
  display: block;
}

/* ベース商品選択時の4カラムレイアウト（ベース商品｜表示順序｜月額料金｜初期費用） */
.form-row-base-product {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1.5fr 1.5fr;
  gap: 15px;
}

.form-row-base-product .form-group select {
  max-width: 100%;
}

/* 表示順序の入力幅（3桁で十分） */
.input-sort-order {
  max-width: 80px !important;
  text-align: right;
}

/* 料金入力の幅（6桁まで） */
.input-price {
  max-width: 120px !important;
  text-align: right;
}

/* 住所とステータスのレイアウト（3:1） */
.form-row-address-status {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 15px;
}

.form-group-address input {
  max-width: 100%;
}

.form-group-status select {
  max-width: 100%;
}

/* レスポンシブ対応：タブレット以下では縦並び */
@media screen and (max-width: 1024px) {
  .form-row-4,
  .form-row-3,
  .form-row-base-product,
  .form-row-address-status {
    grid-template-columns: 1fr;
  }
}

/* 契約期間選択ボックス */
.contract-periods {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.period-box {
  flex: 1;
  position: relative;
  padding: 5px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.3s ease;
}

.period-box:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.15);
}

/* チェックボックスを非表示 */
.period-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* 選択時のスタイル */
.period-box:has(.period-checkbox:checked) {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--text-light);
}

.period-box:has(.period-checkbox:checked) .period-label,
.period-box:has(.period-checkbox:checked) .period-discount {
  color: var(--text-light);
}

.period-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.period-label {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-primary);
}

.period-discount {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 割引率入力フィールド */
.discount-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  pointer-events: auto;
}

.period-box:has(.period-checkbox:checked) .discount-input {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--bg-card);
}

/* チェックボックス未選択時のスタイル */
.period-box:has(.period-checkbox:not(:checked)) {
  opacity: 0.6;
  background: var(--primary-light);
}

.period-box:has(.period-checkbox:not(:checked)):hover {
  opacity: 1;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
  .contract-periods {
    flex-direction: column;
  }
}

.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
}

/* モーダルのサイズ調整 */
.modal-content {
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
}

/* モーダル内のフォーム調整 */
.modal-content .form-table th {
  width: 150px;
}

.modal-content .form-table input[type="text"],
.modal-content .form-table input[type="tel"],
.modal-content .form-table input[type="email"],
.modal-content .form-table select {
  max-width: 100%;
}

/* スクロールバーのカスタマイズ */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: var(--primary-light);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}


/*====================================
product_list.php 商品一覧
====================================*/

/* タブナビゲーション */
.tab-nav {
  display: flex;
  gap: 8px;
  padding: 15px 20px 0;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--primary-light);
}

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: transparent;
}

/* タブコンテンツ */
.tab-contents {
  padding: 20px;
  background: var(--bg-card);
}

.product-section {
  margin-bottom: 30px;
}

.product-section:last-child {
  margin-bottom: 0;
}

/* 商品セクションのヘッダー */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--primary-light);
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 10px;
}

.section-header .section-title {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
  font-weight: bold;
}

.section-header .add-product-btn {
  padding: 8px 20px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.section-header .add-product-btn:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.section-header .add-product-btn:active {
  transform: translateY(0);
}

/* 商品テーブル */
.product-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.product-table thead {
  background: var(--primary-light);
}

.product-table th {
  padding: 12px 15px;
  text-align: left;
  font-weight: bold;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  font-size: 14px;
}

/* ベース商品テーブルの列幅 */
.base-section .product-table th:nth-child(1),
.base-section .product-table td:nth-child(1) {
  width: 200px; /* 商品名 */
}

.base-section .product-table th:nth-child(2),
.base-section .product-table td:nth-child(2) {
  width: 150px; /* 商品ID */
}

.base-section .product-table th:nth-child(3),
.base-section .product-table td:nth-child(3) {
  width: 120px; /* 初期費用 */
  text-align: right;
}

.base-section .product-table th:nth-child(4),
.base-section .product-table td:nth-child(4) {
  width: auto; /* 説明 */
  min-width: 150px;
}

.base-section .product-table th:nth-child(5),
.base-section .product-table td:nth-child(5) {
  width: 100px; /* 状態 */
  text-align: center;
}

.base-section .product-table th:nth-child(6),
.base-section .product-table td:nth-child(6) {
  width: 180px; /* 操作 */
}

/* その他の商品テーブルの列幅 */
.product-section:not(.base-section) .product-table th:nth-child(1),
.product-section:not(.base-section) .product-table td:nth-child(1) {
  width: 200px; /* 商品名 */
}

.product-section:not(.base-section) .product-table th:nth-child(2),
.product-section:not(.base-section) .product-table td:nth-child(2) {
  width: 150px; /* 説明 */
}

.product-section:not(.base-section) .product-table th:nth-child(3),
.product-section:not(.base-section) .product-table td:nth-child(3) {
  width: 120px; /* 月額料金 */
}

.product-section:not(.base-section) .product-table th:nth-child(4),
.product-section:not(.base-section) .product-table td:nth-child(4) {
  width: 120px; /* 初期費用 */
}

.product-section:not(.base-section) .product-table th:nth-child(5),
.product-section:not(.base-section) .product-table td:nth-child(5) {
  width: 100px; /* 状態 */
  text-align: center;
}

.product-section:not(.base-section) .product-table th:nth-child(6),
.product-section:not(.base-section) .product-table td:nth-child(6) {
  width: 180px; /* 操作 */
}

.product-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-primary);
}

.product-table tbody tr:last-child td {
  border-bottom: none;
}

.product-table tbody tr:hover {
  background: var(--hover-bg);
}

/* 料金表示を右揃え（ベース商品以外のテーブル） */
.product-section:not(.base-section) .product-table td:nth-child(3),
.product-section:not(.base-section) .product-table td:nth-child(4) {
  text-align: right;
}

/* 操作列のヘッダーをセンター */
.product-table th:last-child {
  text-align: center;
}

/* 操作ボタンのセル */
.product-table td:last-child {
  text-align: center;
  white-space: nowrap;
}

/* 編集ボタン（商品一覧用） */
.product-table .edit-btn {
  padding: 6px 16px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 8px;
}

.product-table .edit-btn:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* 無効化ボタン */
.product-table .delete-btn {
  padding: 6px 16px;
  background: var(--text-secondary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-table .delete-btn:hover {
  background: var(--accent-red);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.product-table .delete-btn:active {
  transform: translateY(0);
}

/* 状態表示 */
.product-table .status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
}

.product-table .status.active {
  background: var(--accent-green);
  color: var(--text-light);
}

.product-table .status.inactive {
  background: var(--text-secondary);
  color: var(--text-light);
}

/*====================================
group_list.php グループ一覧
====================================*/
.group-list {
  display: grid;
  gap: 20px;
}

.group-card {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.group-header {
  padding: 15px;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.agency-name {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 3px 8px;
  background: var(--bg-main);
  border-radius: 4px;
}


.group-name {
  font-size: 18px;
  margin: 0;
}

.group-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.store-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.store-list {
  /* padding: 15px; */
}

.store-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.store-table th,
.store-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
}

.store-table th {
  text-align: left;
  color: var(--text-secondary);
  font-weight: normal;
}


.group_list .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  resize: vertical;
  min-height: 80px;
}

.group_list .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(28, 168, 215, 0.2);
}

.group_list .form-group textarea::placeholder {
  color: var(--text-secondary);
}





/* セレクトボックスのスタイル */
select {
  appearance: none;  /* デフォルトの矢印を非表示 */
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666666' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;  /* 矢印アイコンのためのスペース */
}

select:hover {
  border-color: var(--accent-blue);
}

select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(28, 168, 215, 0.2);
}

/* プレースホルダーのような最初の選択肢のスタイル */
select option[value=""] {
  color: var(--text-secondary);
}



/*====================================
  operation_group_list.php 拠点管理型グループ一覧
====================================*/

/* グループリスト */
.operation-group-list {
  display: grid;
  gap: 20px;
}

/* グループカード */
.operation-group-card {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

/* 拠点情報 */
.operation-info {
  padding: 15px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-group {
  display: flex;
  gap: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-item .label {
  color: var(--text-secondary);
  font-size: 14px;
}

.info-item .value {
  font-weight: bold;
}

/* 合計金額表示 */
.total-info .value.price {
  color: var(--accent-blue);
  font-size: 16px;
}

.operation_group .store-table th,
.operation_group .store-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.operation_group .store-table th {
  text-align: left;
  color: var(--text-secondary);
  font-weight: normal;
  background: var(--primary-light);
}

/* ホバー効果 */
.operation_group .store-table tbody tr:hover {
  background: var(--hover-bg);
}


/* モーダル設定 */
#operationGroupModal .form-section{
  padding: 0 20px;
}

#operationGroupModal .form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

#operationGroupModal .form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

#operationGroupModal .form-group {
  margin-bottom: 15px;
}


/*====================================
  store_group_list.php 店舗独立型グループ一覧
====================================*/
/* 店舗独立型グループ一覧のスタイル */
.page-title {
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-blue);
}

/* 操作エリア */
.operation-area {
  margin-bottom: 20px;
}

.add-btn {
  padding: 8px 20px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.add-btn:hover {
  background: var(--btn-primary-hover);
}

/* グループリスト */
.store-group-list {
  display: grid;
  gap: 20px;
}

 /* グループカード */
.store-group-card {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

 /* グループヘッダー */
.group-header {
  padding: 15px;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.agency-name {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 3px 8px;
  background: var(--bg-main);
  border-radius: 4px;
}

.group-name {
  font-size: 18px;
  margin: 0;
}

.group-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.store-count {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 管理情報 */
.group-info {
  padding: 15px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-group {
  display: flex;
  gap: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-item .label {
  color: var(--text-secondary);
  font-size: 14px;
}

.info-item .value {
  font-weight: bold;
}

.total-info .value.price {
  color: var(--accent-blue);
  font-size: 16px;
}

/* 店舗リスト */
.store-list {
  /* padding: 15px; */
}

.store-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.store-table th,
.store-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.store-table th {
  text-align: left;
  color: var(--text-secondary);
  font-weight: normal;
  background: var(--primary-light);
}

/* 編集ボタン */
.edit-btn {
  padding: 6px 12px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.edit-btn:hover {
  background: var(--btn-primary-hover);
}

/* ホバー効果 */
.store-table tbody tr:hover {
  background: var(--hover-bg);
}

/* メッセージ表示 */
.message-box {
  margin-top: 10px;
  padding: 10px 15px;
  background: var(--accent-green);
  color: var(--text-light);
  border-radius: 4px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 店舗独立型グループ用のモーダルスタイル */
#storeGroupModal .modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

#storeGroupModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

#storeGroupModal .modal-header h3 {
  font-size: 20px;
  margin: 0;
}

#storeGroupModal .section-title {
  font-size: 16px;
  color: var(--accent-blue);
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
}

#storeGroupModal .form-section{
  padding: 0 20px;
}


/* 横並び用のレイアウト */
#storeGroupModal .form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

#storeGroupModal .form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* フォーム要素のスタイル */
#storeGroupModal .form-group {
  margin-bottom: 15px;
}

#storeGroupModal .form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

#storeGroupModal .form-group input[type="text"],
#storeGroupModal .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

#storeGroupModal .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}

/* フォーカス時のスタイル */
#storeGroupModal .form-group input:focus,
#storeGroupModal .form-group select:focus,
#storeGroupModal .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(28, 168, 215, 0.2);
}

/* 通知エリア */
#storeGroupModal .store-notice {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 10px;
  background: var(--primary-light);
  border-radius: 4px;
  line-height: 1.6;
}

/* ボタンエリア */
#storeGroupModal .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

#storeGroupModal .submit-btn {
  padding: 8px 24px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

#storeGroupModal .submit-btn:hover {
  background: var(--btn-primary-hover);
}

#storeGroupModal .cancel-btn {
  padding: 8px 24px;
  background: var(--primary-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

#storeGroupModal .cancel-btn:hover {
  background: var(--hover-bg);
}

/* スクロールバーのカスタマイズ */
#storeGroupModal .modal-content::-webkit-scrollbar {
  width: 8px;
}

#storeGroupModal .modal-content::-webkit-scrollbar-track {
  background: var(--primary-light);
  border-radius: 4px;
}

#storeGroupModal .modal-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

#storeGroupModal .modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* メッセージボックス用のスタイル */
.message-box {
  margin-top: 10px;
  padding: 10px 15px;
  background: var(--accent-green);
  color: var(--text-light);
  border-radius: 4px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/*====================================
  invoice-list 契約一覧
====================================*/
/* 契約管理ページ専用スタイル */
.invoice-list .content-area {
  padding: 20px;
}

.invoice-list .page-title {
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-blue);
}

/* 操作エリア */
.invoice-list .operation-area {
  margin-bottom: 20px;
}

.invoice-list .csv-btn {
  padding: 8px 20px;
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.invoice-list .csv-btn:hover {
  background: var(--btn-primary-hover);
}

/* テーブル */
.invoice-list .list-table-wrapper {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.invoice-list .list-table {
  width: 100%;
  border-collapse: collapse;
}

/* ヘッダー */
.invoice-list .list-table thead th {
  background: var(--primary-light);
  padding: 15px;
  text-align: left;
  font-weight: bold;
  border-bottom: 2px solid var(--border-color);
}

/* データセル */
.invoice-list .list-table tbody td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

/* 列幅の調整 */
.invoice-list .agency-column { width: 150px; }
.invoice-list .store-column { width: 200px; }
.invoice-list .type-column { width: 150px; }
.invoice-list .plan-column { width: 120px; }
.invoice-list .price-column { width: 100px; text-align: right; }
.invoice-list .note-column { width: 200px; text-align: left;}


/* 操作部分 */
.invoice-list .list-table th.status-column,
.invoice-list .list-table td.status-column {
  text-align: center;
}

/* 操作部分 */
.invoice-list .list-table th.action-column,
.invoice-list .list-table td.action-column {
  text-align: center;
}

/* 行のホバー効果 */
.invoice-list .list-table tbody tr:hover {
  background: var(--hover-bg);
}

/* 偶数行の背景色 */
.invoice-list .list-table tbody tr:nth-child(even) {
  background: var(--primary-light);
}

.invoice-list .list-table tbody tr:nth-child(even):hover {
  background: var(--hover-bg);
}



.invoice-list .list-table td.no-data {
  text-align: center;
}



/* 編集可能な備考欄のスタイル */
.invoice-list .note-text.editing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* 入力フィールドのスタイル */
.invoice-list .note-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
}

.invoice-list .note-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(28, 168, 215, 0.2);
}



/* 保存・キャンセルボタン */
.invoice-list .save-note,
.invoice-list .cancel-note {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.invoice-list .save-note {
  background: var(--btn-primary);
  color: var(--text-light);
  border: none;
}

.invoice-list .save-note:hover {
  background: var(--btn-primary-hover);
}

.invoice-list .cancel-note {
  background: var(--primary-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.invoice-list .cancel-note:hover {
  background: var(--hover-bg);
}

.invoice-list .editable-note {
  display: flex;
  align-items: flex-start; /* flex-startに変更 */
  gap: 10px;
  min-height: 28px; /* 最小の高さを設定 */
}

.invoice-list .note-text {
  flex-grow: 1;
  padding: 2px 5px;
  min-height: 24px; /* 最小の高さを設定 */
  display: flex;
  align-items: center; /* 縦方向の中央揃え */
}

.invoice-list .note-text.editing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}





/* 編集アイコン */
.invoice-list .edit-note-btn {
  background: none;
  border: none;
  padding: 2px 5px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  flex-shrink: 0; /* 追加：ボタンが縮まないように */
  align-self: center; /* 追加：垂直方向の中央揃え */
}

.invoice-list .edit-note-btn:hover {
  opacity: 1;
}

.invoice-list .edit-icon {
  font-style: normal;
  color: var(--text-secondary);
}

/*====================================
  レスポンシブ対応
====================================*/

/* タブレット以下 */
@media screen and (max-width: 1024px) {
  .form-table th {
    width: 140px;
    font-size: 13px;
  }

  .form-table td {
    font-size: 13px;
  }

  .multi-input {
    flex-direction: column;
    gap: 15px;
  }

  .input-group {
    width: 100%;
  }
}

/* スマートフォン */
@media screen and (max-width: 768px) {
  #content {
    margin-left: 0;
    max-width: 100%;
    padding: 10px;
  }

  #side-nav {
    display: none;
  }

  .form-table {
    font-size: 12px;
  }

  .form-table th {
    width: 100px;
    padding: 8px 10px;
  }

  .form-table td {
    padding: 8px 10px;
  }

  .form-table input[type="text"],
  .form-table input[type="tel"],
  .form-table input[type="email"],
  .form-table input[type="url"],
  .form-table select {
    max-width: 100%;
  }

  .submit-btn,
  .cancel-btn {
    padding: 10px 30px;
    font-size: 14px;
  }

  .modal-content {
    max-width: 95%;
    padding: 15px;
  }
}

/*====================================
  通知バッジ（メニュー用）
====================================*/
.badge-notification {
  display: inline-block;
  background-color: #dc3545;
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}