/* 梨屋さん管理画面テーマ（シンプル・洗練・モダン）
   - Django admin の CSS 変数を上書きして、ブランドのグリーンを基調に統一
   - フラットな配色＋余白＋やわらかい影で現代的に
   - ライト/ダークのテーマ切替に追従
*/

/* ===== パレット & Django admin 変数の上書き（ライト） ===== */
:root,
:root[data-theme="light"] {
  --brand: #2e7d32;          /* 基調グリーン */
  --brand-strong: #1b5e20;   /* 濃いグリーン（ホバー等） */
  --brand-tint: #eef6f0;     /* 淡いグリーン（見出し背景） */
  --brand-tint-2: #f6faf7;   /* さらに淡い面 */

  /* Django admin のアクセント系を一括でグリーン化 */
  --primary: var(--brand);
  --secondary: var(--brand);
  --accent: var(--brand-strong);
  --primary-fg: #ffffff;

  --link-fg: #1f6b34;
  --link-hover-color: var(--brand-strong);
  --link-selected-fg: var(--brand-strong);

  --button-bg: var(--brand);
  --button-hover-bg: var(--brand-strong);
  --default-button-bg: var(--brand);
  --default-button-hover-bg: var(--brand-strong);
  --object-tools-bg: var(--brand-strong);
  --object-tools-hover-bg: #163f17;

  --selected-row: #fff8e1;   /* 行選択は控えめなアンバー */
  --selected-bg: var(--brand-tint);

  /* 自前のヘッダ/見出し用 */
  --orch-bar-bg: var(--brand);
  --orch-h2-bg: var(--brand-tint);
  --orch-h2-fg: #103d18;
  --orch-border: #e6e9ec;
  --orch-card-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

/* ===== ダークテーマ ===== */
:root[data-theme="dark"] {
  --brand: #4caf50;
  --brand-strong: #66bb6a;
  --brand-tint: #14301a;
  --brand-tint-2: #11261a;

  --primary: var(--brand);
  --secondary: var(--brand);
  --accent: var(--brand-strong);
  --primary-fg: #0b1f0e;

  --link-fg: #7fd089;
  --link-hover-color: #a5e0ad;
  --link-selected-fg: #a5e0ad;

  --button-bg: var(--brand);
  --button-hover-bg: var(--brand-strong);
  --default-button-bg: var(--brand);
  --default-button-hover-bg: var(--brand-strong);
  --object-tools-bg: #2e7d32;
  --object-tools-hover-bg: #1b5e20;

  --selected-row: #2a2a14;
  --selected-bg: var(--brand-tint);

  --orch-bar-bg: #1b5e20;
  --orch-h2-bg: var(--brand-tint);
  --orch-h2-fg: #e8f5e9;
  --orch-border: #2b2f33;
  --orch-card-shadow: none;
}

/* ===== ヘッダーバー（フラット＋やわらかい影） ===== */
#header,
.sticky #header {
  background: var(--orch-bar-bg) !important;
  color: #fff !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 2px 8px rgba(16, 24, 40, 0.08);
  border-bottom: none !important;
}
#header a,
#header a:link,
#header a:visited,
#header .branding h1,
#header .branding h1 a {
  color: #fff !important;
}
#site-name {
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* ツールバー（object-tools の追加ボタン等）を少し丸く */
.object-tools a {
  border-radius: 8px !important;
  text-transform: none !important;
  letter-spacing: 0;
  font-weight: 600;
}

/* ===== モジュール（セクション）をカード化 ===== */
.module {
  border: 1px solid var(--orch-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--orch-card-shadow);
}

/* セクション見出し：濃い帯をやめ、淡い面＋左アクセントの落ち着いた見出しに */
.module h2,
.module caption,
.inline-group h2,
.module > table > caption {
  background: var(--orch-h2-bg) !important;
  color: var(--orch-h2-fg) !important;
  border-left: 3px solid var(--brand);
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
}
.module h2 a,
.inline-group h2 a,
.module > table > caption a {
  color: var(--orch-h2-fg) !important;
}

/* ===== ボタン（角丸・コンパクト・ブランド色） ===== */
.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  border-radius: 8px !important;
  font-weight: 600;
}
.submit-row {
  border-radius: 0 0 12px 12px;
}

/* ===== 入力フォーカスをブランド色のリングに ===== */
input:focus,
select:focus,
textarea:focus,
.vTextField:focus {
  outline: none !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15) !important;
}

/* ===== テーブルの可読性を少し向上 ===== */
#changelist table thead th {
  text-transform: none;
  letter-spacing: 0;
}

/* ===== changelist の furigana 入力幅を抑制（既存仕様を維持） ===== */
body.app-pears.model-pearvariety.change-list
  .results
  td.field-furigana
  input[type="text"] {
  width: 10ch !important;
  min-width: 8ch !important;
  max-width: 12ch !important;
}
