/**
 * 管理画面用CSS
 * admin.html モックのデザインを再現
 */

/* ── ログイン画面 ── */
.ta-login-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: 100vh !important;
  background: #f0f2f5 !important;
  margin: 0 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}
.ta-login-box {
  background: #fff !important;
  padding: 40px 36px !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
  width: 100% !important;
  max-width: 400px !important;
  text-align: center !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  float: none !important;
}
.ta-login-box *,
.ta-login-box *::before,
.ta-login-box *::after {
  box-sizing: border-box !important;
}
.ta-login-box h1 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #43a047 !important;
  margin: 0 0 28px !important;
  padding: 0 !important;
  line-height: 1.6 !important;
  border: none !important;
  background: none !important;
  text-align: center !important;
}
.ta-login-box form {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}
.ta-login-box label {
  display: block !important;
  text-align: left !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #555 !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
  float: none !important;
  width: auto !important;
}
.ta-login-box input[type="password"] {
  display: block !important;
  width: 100% !important;
  padding: 12px 14px !important;
  font-size: 16px !important;
  border: 2px solid #ddd !important;
  border-radius: 8px !important;
  margin: 0 0 20px !important;
  font-family: inherit !important;
  background: #fff !important;
  color: #333 !important;
  height: auto !important;
  line-height: normal !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
}
.ta-login-box input[type="password"]:focus {
  outline: none !important;
  border-color: #43a047 !important;
  box-shadow: none !important;
}
.ta-login-box button[type="submit"] {
  display: block !important;
  width: 100% !important;
  padding: 14px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #fff !important;
  background: #43a047 !important;
  border: none !important;
  border-radius: 30px !important;
  cursor: pointer !important;
  font-family: inherit !important;
  transition: background 0.2s !important;
  margin: 0 !important;
  float: none !important;
  height: auto !important;
  line-height: normal !important;
  letter-spacing: 0.05em !important;
  text-align: center !important;
  box-shadow: none !important;
}
.ta-login-box button[type="submit"]:hover {
  background: #388e3c !important;
}
.ta-login-error {
  background: #ffebee !important;
  color: #c62828 !important;
  padding: 10px 14px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  margin: 0 0 16px !important;
}

/* ── ヘッダー ── */
.ta-header {
  background: #43a047;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ta-header h1 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.ta-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ta-logout-btn {
  color: #fff;
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s;
}
.ta-logout-btn:hover {
  background: rgba(255,255,255,0.15);
}

/* ── メイン ── */
.ta-main {
  width: 100%;
  margin: 24px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ── タブ ── */
.ta-tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
}
.ta-tab-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px 8px 0 0;
  background: #ddd;
  color: #666;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.ta-tab-btn:hover {
  background: #e8e8e8;
}
.ta-tab-btn.active {
  background: #fff;
  color: #43a047;
}

/* ── タブコンテンツ ── */
.ta-tab-content {
  display: none;
  background: #fff;
  border-radius: 0 8px 8px 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.ta-tab-content.active {
  display: block;
}

/* ── ツールバー ── */
.ta-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.ta-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ta-filter-select {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
}
.ta-count {
  font-size: 13px;
  color: #888;
}
.ta-totals {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid #ddd;
}
.ta-total-item {
  font-size: 13px;
  color: #555;
}
.ta-total-item strong {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-left: 4px;
}
.ta-total-paid strong {
  color: #43a047;
}

/* ── 金額セル（テーブル内） ── */
.ta-amount-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
  white-space: nowrap;
  line-height: 1.4;
}
.ta-amount-detail {
  font-size: 11px;
  color: #888;
}
.ta-amount-total {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px solid #eee;
}
.ta-amount-zero {
  font-size: 12px;
  color: #bbb;
}
.ta-csv-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #43a047;
  background: #fff;
  border: 1px solid #43a047;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.ta-csv-btn:hover {
  background: #e8f5e9;
}

/* ── テーブル ── */
.ta-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.ta-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 12px;
}
.ta-table th {
  background: #f5f5f5;
  padding: 8px 8px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e0e0e0;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
.ta-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* ── 協賛テーブル：列ごとの幅 ── */
/* 申込日(1) | 団体名(2) | パンフ(3) | 展示(4) | 金額(5) | 担当者(6) | 連絡先(7) | パンフ(8) | ロゴ(9) | URL(10) | 入金(11) | デザイン(12) | ステータス(13) | 自社担当(14) | 備考(15) */
#table-sponsorships th:nth-child(1),
#table-sponsorships td:nth-child(1) { width: 80px; white-space: nowrap; }
#table-sponsorships th:nth-child(5),
#table-sponsorships td:nth-child(5) { width: 110px; white-space: nowrap; }
#table-sponsorships th:nth-child(8),
#table-sponsorships th:nth-child(9),
#table-sponsorships th:nth-child(10),
#table-sponsorships th:nth-child(11),
#table-sponsorships th:nth-child(12),
#table-sponsorships td:nth-child(8),
#table-sponsorships td:nth-child(9),
#table-sponsorships td:nth-child(10),
#table-sponsorships td:nth-child(11),
#table-sponsorships td:nth-child(12) {
  width: 32px;
  text-align: center;
  white-space: nowrap;
}
#table-sponsorships th:nth-child(13),
#table-sponsorships td:nth-child(13) { width: 80px; white-space: nowrap; }
#table-sponsorships th:nth-child(15),
#table-sponsorships td:nth-child(15) { min-width: 140px; }

/* ── マルシェテーブル：列ごとの幅 ── */
/* 申込日(1) | 団体名(2) | 出店名(3) | 担当者(4) | 連絡先(5) | 参考画像(6) | 入金(7) | ステータス(8) | 自社担当(9) | 備考(10) */
#table-workshop th:nth-child(1),
#table-workshop td:nth-child(1) { width: 80px; white-space: nowrap; }
#table-workshop th:nth-child(6),
#table-workshop th:nth-child(7),
#table-workshop td:nth-child(6),
#table-workshop td:nth-child(7) {
  width: 36px;
  text-align: center;
  white-space: nowrap;
}
#table-workshop th:nth-child(8),
#table-workshop td:nth-child(8) { width: 80px; white-space: nowrap; }
#table-workshop th:nth-child(10),
#table-workshop td:nth-child(10) { min-width: 140px; }
.ta-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
.ta-table tbody tr:hover {
  background: #f6fdf6;
}
.ta-loading {
  text-align: center;
  color: #999;
  padding: 40px 0 !important;
}

/* ── ステータスバッジ ── */
.ta-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.ta-badge--受付   { background: #e3f2fd; color: #1565c0; }
.ta-badge--確認中  { background: #fff3e0; color: #e65100; }
.ta-badge--入金待ち { background: #fce4ec; color: #c62828; }
.ta-badge--出店確定 { background: #e8f5e9; color: #2e7d32; }
.ta-badge--完了   { background: #f5f5f5; color: #757575; }

/* ── アイコン ── */
.ta-icon-ok {
  color: #43a047;
  font-weight: 700;
}
.ta-icon-ng {
  color: #ccc;
}

/* ── PII マスキング ── */
.ta-masked {
  color: transparent;
  text-shadow: 0 0 8px rgba(0,0,0,0.3);
  cursor: pointer;
  user-select: none;
}
.ta-masked a {
  color: transparent;
  text-shadow: 0 0 8px rgba(0,0,0,0.3);
  pointer-events: none;
}
.ta-masked.revealed {
  color: inherit;
  text-shadow: none;
}
.ta-masked.revealed a {
  color: #1976d2;
  text-shadow: none;
  pointer-events: auto;
}

/* ── モーダル ── */
.ta-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
}
.ta-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  position: relative;
}
.ta-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.ta-modal-close:hover {
  color: #333;
}
.ta-modal-title {
  padding: 20px 24px 16px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid #eee;
}
.ta-modal-body {
  padding: 0 24px 20px;
  max-height: 65vh;
  overflow-y: auto;
}
.ta-modal-section {
  margin-top: 20px;
}
.ta-modal-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: #43a047;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8f5e9;
}

/* 詳細テーブル */
.ta-detail-table {
  width: 100%;
  font-size: 13px;
}
.ta-detail-table th {
  width: 120px;
  padding: 6px 0;
  font-weight: 600;
  color: #666;
  vertical-align: top;
  text-align: left;
}
.ta-detail-table td {
  padding: 6px 0;
}

/* ロゴセクション */
.ta-logo-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ta-logo-url {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.ta-logo-url input {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f9f9f9;
}
.ta-copy-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #43a047;
  color: #43a047;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.ta-copy-btn:hover {
  background: #e8f5e9;
}

/* マルシェセクション */
.ta-marche-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.ta-marche-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.ta-marche-item a {
  color: #1976d2;
  text-decoration: none;
  word-break: break-all;
}
.ta-marche-item a:hover {
  text-decoration: underline;
}

/* ファイルプレビュー */
.ta-file-preview {
  margin: 10px 0;
  padding: 10px;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 6px;
  text-align: center;
}
.ta-file-preview img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 4px;
  object-fit: contain;
}
.ta-file-url {
  margin: 6px 0 10px;
  font-size: 12px;
  word-break: break-all;
}
.ta-file-url-label {
  font-weight: 600;
  color: #666;
  margin-right: 6px;
}
.ta-file-url a {
  color: #1976d2;
  text-decoration: none;
}
.ta-file-url a:hover {
  text-decoration: underline;
}
.ta-upload-url-section {
  margin-top: 10px;
}
.ta-upload-url-section .ta-file-url-label {
  display: block;
  margin-bottom: 4px;
}

/* 編集フィールド */
.ta-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ta-edit-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}
.ta-edit-field select,
.ta-edit-field input[type="text"],
.ta-edit-field textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.ta-edit-field textarea {
  min-height: 60px;
  resize: vertical;
}
.ta-edit-field .ta-checkbox-row {
  display: flex;
  gap: 20px;
}
.ta-edit-field .ta-checkbox-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* 更新履歴 */
.ta-history {
  max-height: 200px;
  overflow-y: auto;
}
.ta-history-item {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid #f5f5f5;
}
.ta-history-date {
  color: #999;
  white-space: nowrap;
  flex-shrink: 0;
}
.ta-history-content {
  color: #333;
}

/* モーダルフッター */
.ta-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  text-align: right;
}
.ta-save-btn {
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #43a047;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.ta-save-btn:hover {
  background: #388e3c;
}
.ta-save-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ── レスポンシブ ── */
@media (max-width: 768px) {
  .ta-main { padding: 0 10px; margin: 12px auto; }
  .ta-tab-btn { padding: 8px 14px; font-size: 12px; }
  .ta-tab-content { padding: 12px; }
  .ta-table { font-size: 12px; }
  .ta-modal { margin-top: 20px; }
  .ta-overlay { padding: 20px 10px; }
}
