/* =====================================================
   バイトル二次代理店受付システム - 共通スタイル
   ===================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Meiryo', 'Yu Gothic', '游ゴシック', sans-serif;
  font-size: 13px;
  background: #f0f2f5;
  color: #333;
}

a { color: #1976d2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── ヘッダー ─────────────────────────────── */
#header {
  background: #1565c0;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
#header .header-left {
  display: flex;
  align-items: center;
}
#header .header-logo {
  height: 36px;
  margin-right: 12px;
  display: block;
}
#header .site-title { font-size: 16px; font-weight: bold; }
#header .user-info { font-size: 12px; }
#header .user-info span { margin-left: 12px; }
#header .btn-logout {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 12px;
}
#header .btn-logout:hover { background: rgba(255,255,255,.3); }

/* ── ロゴ（左上固定） ─────────────────────── */
.logo-top-left {
  position: fixed;
  top: 16px;
  left: 20px;
  z-index: 100;
}
.logo-top-left img {
  height: 40px;
  display: block;
}

/* ── ログインページ ───────────────────────── */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1565c0 0%, #0288d1 100%);
}
.login-box {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.login-box h1 {
  font-size: 18px;
  color: #1565c0;
  text-align: center;
  margin-bottom: 8px;
}
.login-box .subtitle {
  font-size: 12px;
  color: #888;
  text-align: center;
  margin-bottom: 28px;
}
.login-box .form-group { margin-bottom: 16px; }
.login-box label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; }
.login-box input[type="email"],
.login-box input[type="password"],
.login-box input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.login-box input:focus { border-color: #1976d2; }
.btn-primary {
  width: 100%;
  padding: 12px;
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
  transition: background .2s;
}
.btn-primary:hover { background: #0d47a1; }
.btn-primary:disabled { background: #90a4ae; cursor: default; }
.login-box .forgot-link {
  display: block;
  text-align: center;
  font-size: 12px;
  margin-top: 12px;
}
#login-error, #login-msg {
  margin-top: 12px;
  padding: 8px;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  display: none;
}
#login-error { background: #ffebee; color: #c62828; }
#login-msg   { background: #e8f5e9; color: #2e7d32; }

/* ── メインレイアウト ─────────────────────── */
#main-wrap { padding: 16px; max-width: 1100px; margin: 0 auto; }

/* ── セクション ──────────────────────────── */
.section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
}
.section-title {
  background: #1565c0;
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
}
.section-body { padding: 16px; }

/* ── フォーム共通 ─────────────────────────── */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.form-row label {
  min-width: 140px;
  font-size: 12px;
  color: #555;
  flex-shrink: 0;
}
.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row input[type="time"],
.form-row select,
.form-row textarea {
  padding: 6px 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: #1976d2; }
.form-row input[type="text"] { width: 240px; }
.form-row input[type="number"] { width: 80px; }
.form-row input[type="date"] { width: 160px; }
.form-row input.short { width: 80px; }
.form-row input.medium { width: 160px; }
.form-row input.long { width: 340px; }
.form-row select.medium { width: 180px; }
.form-row select.long { width: 340px; }
.form-row input[disabled] { background: #f5f5f5; color: #888; }
.form-row textarea { width: 600px; height: 80px; resize: vertical; }
.form-row .dash { padding: 0 4px; color: #666; }
.form-row .required { color: #c62828; margin-left: 2px; }
.form-row .hint { font-size: 11px; color: #888; margin-left: 4px; }

/* ラジオ・チェックボックス */
.form-row .radio-group label,
.form-row .check-label {
  min-width: auto;
  margin-right: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── 掲載先ブロック ───────────────────────── */
.listing-location {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
  position: relative;
}
.listing-location .block-title {
  font-size: 12px;
  font-weight: bold;
  color: #1565c0;
  margin-bottom: 10px;
}
.btn-remove-location {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef5350;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

/* ── 申込商品ブロック ─────────────────────── */
.product-block {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  background: #f9f9ff;
}
.product-block .block-title {
  font-size: 12px;
  font-weight: bold;
  color: #1565c0;
  margin-bottom: 10px;
}
.product-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.product-row select { font-size: 12px; padding: 5px 6px; border: 1px solid #bbb; border-radius: 4px; background: #f0f8ff; }
.product-row select.cp-select { background: #fffaf0; }
.price-display {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  color: #1565c0;
  min-width: 120px;
}

/* ── ボタン群 ─────────────────────────────── */
.btn-add {
  background: #43a047;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}
.btn-add:hover { background: #388e3c; }
.btn-save {
  background: #f57c00;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 32px;
  font-size: 15px;
  cursor: pointer;
  margin-right: 12px;
}
.btn-save:hover { background: #e65100; }
.btn-submit {
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 32px;
  font-size: 15px;
  cursor: pointer;
}
.btn-submit:hover { background: #0d47a1; }
.btn-submit:disabled { background: #90a4ae; cursor: default; }

.action-bar {
  text-align: center;
  padding: 20px;
  background: #fff;
  border-top: 2px solid #e0e0e0;
  margin-top: 16px;
}

/* ── アラート ─────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 13px;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* ── 管理パネル ───────────────────────────── */
.admin-tabs {
  display: flex;
  border-bottom: 2px solid #1565c0;
  margin-bottom: 16px;
}
.admin-tab {
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  font-size: 13px;
  color: #555;
  border: 1px solid #ddd;
  border-bottom: none;
  background: #f5f5f5;
  margin-right: 4px;
}
.admin-tab.active {
  background: #1565c0;
  color: #fff;
  border-color: #1565c0;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.data-table th {
  background: #1565c0;
  color: #fff;
  padding: 8px 10px;
  text-align: left;
}
table.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #eee;
}
table.data-table tr:hover td { background: #f5f5f5; }

/* ── ローディング ─────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  display: none;
}
.spinner {
  width: 40px; height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #1565c0;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
