/* ============================================================
   入札レーダー ダッシュボード スタイルシート
   AI感を避けるためカードを多用しすぎず、表ベースで実用度優先。
   ============================================================ */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e3e2dd;
  --text: #1c1c1a;
  --muted: #6b6962;
  --accent: #1f4d3c;          /* 落ち着いたグリーン */
  --accent-soft: #e8efe9;
  --red: #c0392b;
  --yellow: #b8860b;
  --green: #2e7d32;
  --row-checked: #f3f3ef;
  --link: #1d4ed8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); font-size: 12px; }

/* ============= サイトヘッダー / フッター ============= */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.site-header__brand a {
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.site-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-header__counts {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.site-header__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.site-header__email { color: var(--muted); }
.link-button {
  border: none;
  background: none;
  color: var(--link);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.link-button:hover { text-decoration: underline; }

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.site-footer {
  margin-top: 48px;
  padding: 20px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { color: var(--link); }
.site-footer__small {
  margin-top: 4px;
  font-size: 11px;
}

/* ============= ボタン / フォーム ============= */
.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #fafaf7; }
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: #173a2c; color: #fff; }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--sm { padding: 4px 10px; font-size: 12px; }

/* ============= ログイン画面 ============= */
.login-card {
  max-width: 360px;
  margin: 64px auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 20px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row span { font-size: 12px; color: var(--muted); }
.form-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.alert {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
}
.alert--error {
  background: #fde8e6;
  color: var(--red);
  border: 1px solid #f4b8b1;
}

/* ============= フィルタバー ============= */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.filter-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-form__row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.filter-label { color: var(--muted); font-size: 11px; }
.filter-form__row select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  min-width: 140px;
}

/* ============= テーブル ============= */
.bid-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bid-table thead th {
  background: #fafaf7;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 8px;
  font-weight: 600;
}
.bid-row td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.bid-row:last-child td { border-bottom: none; }
.bid-row__urgency { font-size: 16px; }
.bid-row__date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.bid-row__pref { white-space: nowrap; }
.bid-row__title a { color: var(--text); font-weight: 600; }
.bid-row__title a:hover { color: var(--accent); }
.bid-row__org {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.bid-row__cat { white-space: nowrap; }
.bid-row__conf { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bid-row__link a { font-size: 12px; }
.bid-row__actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.bid-row--checked { background: var(--row-checked); }
.bid-row--checked .bid-row__title a { color: var(--muted); font-weight: 500; }
.bid-row--red .bid-row__urgency { color: var(--red); }
.bid-row--yellow .bid-row__urgency { color: var(--yellow); }
.bid-row--green .bid-row__urgency { color: var(--green); }

/* ============= バッジ・チップ ============= */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #eee;
  color: var(--text);
}
.badge--video { background: #fce7e0; color: #b14f24; }
.badge--streaming { background: #e8eafc; color: #3b3b8a; }
.badge--pr { background: #f6e1ee; color: #9a2a78; }
.badge--hp { background: #e0f2f1; color: #1a4f4e; }
.badge--sns { background: #fff2cf; color: #8a6500; }
.badge--dx { background: #e8efe9; color: var(--accent); }
.badge--other, .badge--unknown { background: #ececec; color: #555; }

.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.chip--on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.chip--off { color: var(--muted); }

/* ============= 詳細ページ ============= */
.detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.detail-toolbar__actions {
  display: flex;
  gap: 8px;
}
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.detail-urgency { font-size: 12px; color: var(--muted); }
.detail-urgency--red { color: var(--red); }
.detail-urgency--yellow { color: var(--yellow); }
.detail-urgency--green { color: var(--green); }
.detail-title {
  margin: 4px 0 12px;
  font-size: 22px;
  line-height: 1.4;
}
.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-title {
  margin: 24px 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.kv-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4px 16px;
  font-size: 13px;
}
.kv-row {
  display: contents;
}
.kv-label {
  color: var(--muted);
  padding: 4px 0;
}
.kv-value {
  padding: 4px 0;
  word-break: break-word;
}
.description {
  background: #fafaf7;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  max-height: 400px;
  overflow: auto;
}

/* ============= 空状態 ============= */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
}

/* ============= ユーティリティ ============= */
form.inline { display: inline-block; }
