/*
 * Liquid Glass UI — application.css
 * テーマ: 黄緑アクセント (#9ACD32) + Glass Morphism
 * ダークモード デフォルト、ライトモード対応
 */

/* ── ローディングオーバーレイ ───────────────────────────────── */
#loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  align-items: center;
  justify-content: center;
}
#loading-overlay.is-active {
  display: flex;
}

/* Spinkit Cube Grid */
.sk-cube-grid {
  width: 40px;
  height: 40px;
  margin: 100px auto;
}

.sk-cube-grid .sk-cube {
  width: 33%;
  height: 33%;
  background-color: currentColor;
  float: left;
  -webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
          animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; 
}
.sk-cube-grid .sk-cube1 {
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s; }
.sk-cube-grid .sk-cube2 {
  -webkit-animation-delay: 0.3s;
          animation-delay: 0.3s; }
.sk-cube-grid .sk-cube3 {
  -webkit-animation-delay: 0.4s;
          animation-delay: 0.4s; }
.sk-cube-grid .sk-cube4 {
  -webkit-animation-delay: 0.1s;
          animation-delay: 0.1s; }
.sk-cube-grid .sk-cube5 {
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s; }
.sk-cube-grid .sk-cube6 {
  -webkit-animation-delay: 0.3s;
          animation-delay: 0.3s; }
.sk-cube-grid .sk-cube7 {
  -webkit-animation-delay: 0s;
          animation-delay: 0s; }
.sk-cube-grid .sk-cube8 {
  -webkit-animation-delay: 0.1s;
          animation-delay: 0.1s; }
.sk-cube-grid .sk-cube9 {
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s; }

@-webkit-keyframes sk-cubeGridScaleDelay {
  0%, 70%, 100% {
    -webkit-transform: scale3D(1, 1, 1);
            transform: scale3D(1, 1, 1);
  } 35% {
    -webkit-transform: scale3D(0, 0, 1);
            transform: scale3D(0, 0, 1); 
  }
}

@keyframes sk-cubeGridScaleDelay {
  0%, 70%, 100% {
    -webkit-transform: scale3D(1, 1, 1);
            transform: scale3D(1, 1, 1);
  } 35% {
    -webkit-transform: scale3D(0, 0, 1);
            transform: scale3D(0, 0, 1);
  } 
}

/* =====================================================
   CSS カスタムプロパティ — ダークモード（デフォルト）
   ===================================================== */
:root {
  /* ── Accent (黄緑) ── */
  --accent:        #9ACD32;
  --accent-strong: #7ab123;
  --accent-light:  #B6E05B;
  --on-accent:     #07200a;

  /* ── Dark base ── */
  --bg:    #050d18;
  --text:  #e2f0d0;
  --muted: #92aa78;

  /* ── Glass system ── */
  --surface:          rgba(12, 22, 36, 0.72);
  --gl-blur:          blur(22px) saturate(180%) brightness(0.97);
  --gl-border-accent: rgba(154, 205, 50, 0.20);
  --gl-border-white:  rgba(255, 255, 255, 0.08);
  --gl-shadow:
    0 2px 6px  rgba(0, 0, 0, 0.32),
    0 12px 40px rgba(0, 0, 0, 0.52);
  --gl-inset:     inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --gl-specular:  linear-gradient(165deg,
      rgba(255, 255, 255, 0.13) 0%,
      rgba(255, 255, 255, 0.04) 50%,
      rgba(0, 0, 0, 0.02) 100%);

  /* ── Radii ── */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  /* ── Motion ── */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    0.25s;
}

/* Bootstrap カラー変数と同期 */
body {
  --bs-body-bg:          var(--bg);
  --bs-body-color:       var(--text);
  --bs-border-color:     rgba(154, 205, 50, 0.18);
  --bs-link-color:       var(--accent);
  --bs-link-hover-color: var(--accent-light);
}

/* ── Background + 浮遊オーブ ─────────────────────────────── */
html { background-color: var(--bg); }

body {
  background-color: transparent;
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle 700px at 15% 25%,  rgba(154, 205, 50, 0.14) 0%, transparent 70%),
    radial-gradient(circle 600px at 85% 75%,  rgba(80,  190, 90,  0.10) 0%, transparent 65%),
    radial-gradient(circle 450px at 75% 8%,   rgba(60,  170, 220, 0.07) 0%, transparent 60%),
    radial-gradient(circle 500px at 30% 88%,  rgba(200, 230, 50,  0.06) 0%, transparent 60%),
    linear-gradient(160deg, #050d18 0%, #060f10 45%, #050810 100%);
  animation: bg-drift 28s ease-in-out infinite alternate;
  pointer-events: none;
  will-change: transform;
}

@keyframes bg-drift {
  0%   { transform: scale(1)    translate(0%,    0%); }
  50%  { transform: scale(1.04) translate(0.8%, -0.8%); }
  100% { transform: scale(1.02) translate(-0.5%, 0.5%); }
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar.bg-primary {
  background: rgba(154, 205, 50, 0.08) !important;
  backdrop-filter: var(--gl-blur);
  -webkit-backdrop-filter: var(--gl-blur);
  border-bottom: 1px solid var(--gl-border-accent);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.42), var(--gl-inset) !important;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar.bg-primary,
.navbar.bg-primary .navbar-brand,
.navbar.bg-primary .nav-link,
.navbar.bg-primary .navbar-text { color: var(--text) !important; }

.navbar.bg-primary .nav-link:hover,
.navbar.bg-primary .nav-link:focus  { color: var(--accent-light) !important; }

.navbar.bg-primary .nav-link.active { color: var(--accent) !important; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  border-radius: var(--r-sm);
  transition: all var(--t) var(--ease);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg,
      rgba(154, 205, 50, 0.92) 0%,
      rgba(122, 177, 35, 0.96) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(154, 205, 50, 0.60);
  color: var(--on-accent);
  box-shadow:
    0 2px 8px  rgba(154, 205, 50, 0.25),
    0 1px 3px  rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, rgba(122,177,35,1.0) 0%, rgba(97,145,26,1.0) 100%);
  box-shadow:
    0 4px 18px rgba(154, 205, 50, 0.42),
    0 2px 6px  rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  color: var(--on-accent);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(154, 205, 50, 0.25);
}

/* ── Outline Buttons — Liquid Glass base ─────────────────── */
[class*="btn-outline-"] {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow:
    0 2px 8px  rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

[class*="btn-outline-"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.10) 0%,
    transparent 55%);
  border-radius: inherit;
  pointer-events: none;
}

[class*="btn-outline-"]:active { transform: translateY(0) !important; }

.btn-outline-primary {
  color: var(--accent-light);
  border: 1px solid rgba(154, 205, 50, 0.55);
  background: rgba(154, 205, 50, 0.13);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: rgba(154, 205, 50, 0.24);
  border-color: rgba(154, 205, 50, 0.88);
  color: #fff;
  box-shadow:
    0 4px 20px rgba(154, 205, 50, 0.40),
    0 2px 6px  rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  color: var(--text);
  border: 1px solid rgba(146, 170, 120, 0.45);
  background: rgba(146, 170, 120, 0.11);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: rgba(146, 170, 120, 0.22);
  color: #fff;
  border-color: rgba(146, 170, 120, 0.78);
  box-shadow:
    0 4px 16px rgba(146, 170, 120, 0.30),
    0 2px 6px  rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.btn-outline-success {
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.50);
  background: rgba(74, 222, 128, 0.13);
}
.btn-outline-success:hover,
.btn-outline-success:focus {
  background: rgba(74, 222, 128, 0.24);
  color: #fff;
  border-color: rgba(74, 222, 128, 0.88);
  box-shadow:
    0 4px 20px rgba(74, 222, 128, 0.40),
    0 2px 6px  rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.btn-outline-danger {
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.50);
  background: rgba(248, 113, 113, 0.13);
}
.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: rgba(248, 113, 113, 0.24);
  color: #fff;
  border-color: rgba(248, 113, 113, 0.88);
  box-shadow:
    0 4px 20px rgba(248, 113, 113, 0.40),
    0 2px 6px  rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.btn-outline-warning {
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.52);
  background: rgba(251, 191, 36, 0.13);
}
.btn-outline-warning:hover,
.btn-outline-warning:focus {
  background: rgba(251, 191, 36, 0.24);
  color: #fff;
  border-color: rgba(251, 191, 36, 0.88);
  box-shadow:
    0 4px 20px rgba(251, 191, 36, 0.40),
    0 2px 6px  rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.navbar .btn-outline-light {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.10);
}
.navbar .btn-outline-light:hover,
.navbar .btn-outline-light:focus {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow:
    0 4px 16px rgba(255, 255, 255, 0.18),
    0 2px 6px  rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

/* ── Cards ───────────────────────────────────────────────── */
/*
  backdrop-filter を .card 本体ではなく ::before 疑似要素に適用する。
  【理由①】backdrop-filter を持つ要素は CSS 仕様上 position:fixed の子要素の
    含有ブロック (containing block) になるため、Bootstrap モーダルが
    カード内に配置されているとビューポーク基準ではなくカード基準で
    固定されて overflow:hidden にクリップされる → 真っ黒問題を防ぐ。
  【理由②】isolation:isolate（や z-index 指定）は stacking context を生成する。
    stacking context 内の z-index はその context 内でしか評価されないため、
    Bootstrap backdrop (z-index:1050, body 直下) がカード全体を覆い、
    カード内のモーダルダイアログ (z-index:1055) が backdrop の背後に隠れて
    操作不能になる。→ .card に stacking context を作らないことで解決。
  .card::before の z-index:-1 はルート stacking context で評価されるが、
  overflow:hidden によって card の bounds にクリップされるため問題なし。
*/
.card {
  background: var(--gl-specular), var(--surface) !important;
  border: 1px solid var(--gl-border-accent) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--gl-shadow), var(--gl-inset);
  color: var(--text);
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}

/* グラスモーフィズムのブラー効果は ::before で実現（isolation は付けない） */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: var(--gl-blur);
  -webkit-backdrop-filter: var(--gl-blur);
  z-index: -1;
  pointer-events: none;
}

.card:hover {
  box-shadow:
    0 2px 6px  rgba(0, 0, 0, 0.32),
    0 16px 52px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(154, 205, 50, 0.20);
}

.card-body { background: transparent !important; color: var(--text); }
.card.shadow,
.card.shadow-sm { box-shadow: var(--gl-shadow), var(--gl-inset) !important; }

/* ── Tables ──────────────────────────────────────────────── */
.table {
  background: transparent;
  color: var(--text);
  --bs-table-color:       var(--text);
  --bs-table-bg:          transparent;
  --bs-table-striped-bg:  rgba(154, 205, 50, 0.03);
  --bs-table-hover-bg:    rgba(154, 205, 50, 0.07);
  --bs-table-border-color: rgba(154, 205, 50, 0.10);
}

.table thead th,
.table-light thead,
thead.table-light {
  background: rgba(154, 205, 50, 0.08) !important;
  color: var(--accent-light) !important;
  border-bottom: 1px solid var(--gl-border-accent) !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.80em;
  text-transform: uppercase;
  /* Bootstrap の --bs-table-bg をリセットして濃い色が残らないようにする */
  --bs-table-bg: transparent;
  --bs-table-color: var(--accent-light);
}

.table th, .table td { white-space: nowrap; vertical-align: middle; }

.table tbody tr {
  transition: background var(--t) var(--ease);
  border-color: rgba(154, 205, 50, 0.08);
}

.table-hover tbody tr:hover {
  background: rgba(154, 205, 50, 0.07) !important;
  color: var(--text);
}

/* ── Form Controls ───────────────────────────────────────── */
.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(154, 205, 50, 0.20) !important;
  border-radius: var(--r-sm) !important;
  color: var(--text) !important;
  transition:
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}

.form-control::placeholder { color: var(--muted); opacity: 1; }

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: var(--accent) !important;
  box-shadow:
    0 0 0 3px rgba(154, 205, 50, 0.18),
    0 0 14px rgba(154, 205, 50, 0.12) !important;
  color: var(--text) !important;
}

.form-label { color: var(--muted); font-size: 0.85em; font-weight: 500; }
.form-select option { background: #0d1a28; color: var(--text); }

/* ── Links ───────────────────────────────────────────────── */
a { color: var(--accent); text-decoration: none; transition: color var(--t) var(--ease); }
a:hover { color: var(--accent-light); }

/* テーブル内リンク: 本文色で読みやすく、ホバー時にアクセント色 */
.table a, .table-link {
  color: var(--text);
  text-decoration: none;
  transition: color var(--t) var(--ease);
}
.table a:hover, .table-link:hover { color: var(--accent-light); }

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown-menu {
  background: rgba(8, 16, 28, 0.90) !important;
  backdrop-filter: blur(24px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(180%) brightness(1.05);
  border: 1px solid var(--gl-border-accent) !important;
  border-radius: var(--r-md) !important;
  box-shadow:
    0 4px 16px  rgba(0, 0, 0, 0.42),
    0 20px 60px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 6px;
  color: var(--text);
}

.dropdown-item {
  border-radius: var(--r-sm);
  color: var(--text) !important;
  padding: 0.42rem 0.78rem;
  font-size: 0.9em;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(154, 205, 50, 0.12) !important;
  color: var(--accent-light) !important;
}

.dropdown-divider { border-color: rgba(154, 205, 50, 0.14) !important; }

/* ── Modal — Liquid Glass ────────────────────────────────── */
.modal-backdrop {
  background-color: rgba(2, 8, 18, 0.55) !important;
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  opacity: 1 !important;
}

.modal-content {
  background: var(--gl-specular), rgba(10, 20, 34, 0.80);
  backdrop-filter: blur(32px) saturate(200%) brightness(0.96);
  -webkit-backdrop-filter: blur(32px) saturate(200%) brightness(0.96);
  border: 1px solid var(--gl-border-accent);
  border-radius: var(--r-lg) !important;
  box-shadow:
    0 4px 16px  rgba(0, 0, 0, 0.45),
    0 28px 80px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text);
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(180deg,
    rgba(154, 205, 50, 0.09) 0%,
    transparent 100%);
  border-bottom: 1px solid rgba(154, 205, 50, 0.16);
  padding: 1.1rem 1.4rem;
}

.modal-title {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.modal-body { padding: 1.25rem 1.4rem; }

.modal-footer {
  border-top: 1px solid rgba(154, 205, 50, 0.12);
  padding: 0.85rem 1.4rem;
  background: rgba(0, 0, 0, 0.12);
}

/* ── Pagination ──────────────────────────────────────────── */
.page-link {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(154, 205, 50, 0.18);
  color: var(--accent);
  border-radius: var(--r-sm) !important;
  margin: 0 2px;
  transition: all var(--t) var(--ease);
}
.page-link:hover {
  background: rgba(154, 205, 50, 0.15);
  color: var(--accent-light);
  border-color: var(--accent);
}
.page-item.active .page-link {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 14px rgba(154, 205, 50, 0.38);
}
.page-item.disabled .page-link {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(154, 205, 50, 0.08);
  color: var(--muted);
}

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-radius: var(--r-md) !important;
}
.alert-success {
  background: rgba(74, 222, 128, 0.10) !important;
  border-color: rgba(74, 222, 128, 0.30) !important;
  color: #86efac !important;
}
.alert-danger {
  background: rgba(248, 113, 113, 0.10) !important;
  border-color: rgba(248, 113, 113, 0.30) !important;
  color: #fca5a5 !important;
}
.alert-warning {
  background: rgba(251, 191, 36, 0.10) !important;
  border-color: rgba(251, 191, 36, 0.30) !important;
  color: #fde68a !important;
}
.alert-info {
  background: rgba(96, 165, 250, 0.10) !important;
  border-color: rgba(96, 165, 250, 0.30) !important;
  color: #bfdbfe !important;
}
.btn-close { filter: invert(1) opacity(0.55); transition: filter var(--t) var(--ease); }
.btn-close:hover { filter: invert(1) opacity(1); }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { color: var(--text); }
.text-muted    { color: var(--muted) !important; }
.text-secondary { color: var(--muted) !important; }
hr { border-color: rgba(154, 205, 50, 0.12); }

/* ── Sidebar / vertical nav ──────────────────────────────── */
.sidebar, .app-sidebar, .nav-flex-sidebar, .nav-column {
  background: var(--surface);
  color: var(--text);
}
.sidebar .nav-link,
.nav.flex-column .nav-link,
.nav-pills .nav-link { color: var(--muted); }
.sidebar .nav-link.active,
.nav.flex-column .nav-link.active,
.nav-pills .nav-link.active {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* ── Theme toggle ────────────────────────────────────────── */
#theme-toggle {
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================
   ライトモード (prefers-color-scheme: light)
   ===================================================== */
@media (prefers-color-scheme: light) {
  :root {
    --bg:    #eef7e0;
    --text:  #1a3010;
    --muted: #5a7040;
    --surface:          rgba(255, 255, 255, 0.68);
    --gl-blur:          blur(20px) saturate(160%) brightness(1.02);
    --gl-border-accent: rgba(122, 177, 35, 0.28);
    --gl-border-white:  rgba(255, 255, 255, 0.55);
    --gl-shadow:
      0 2px 6px  rgba(90, 130, 20, 0.10),
      0 12px 40px rgba(90, 130, 20, 0.14);
    --gl-inset:    inset 0 1px 0 rgba(255, 255, 255, 0.55);
    --gl-specular: linear-gradient(165deg,
        rgba(255,255,255,0.55) 0%,
        rgba(255,255,255,0.15) 55%,
        rgba(255,255,255,0.03) 100%);
  }

  body::before {
    background:
      radial-gradient(circle 700px at 15% 25%, rgba(154, 205, 50, 0.22) 0%, transparent 70%),
      radial-gradient(circle 600px at 85% 75%, rgba(80,  190, 90,  0.16) 0%, transparent 65%),
      radial-gradient(circle 450px at 75% 8%,  rgba(60,  170, 220, 0.10) 0%, transparent 60%),
      linear-gradient(160deg, #dff0c0 0%, #eaf7d0 100%);
  }

  body { color: var(--text); --bs-body-color: var(--text); }

  .navbar.bg-primary {
    background: rgba(154, 205, 50, 0.25) !important;
    border-bottom-color: rgba(122, 177, 35, 0.35);
  }
  .navbar.bg-primary,
  .navbar.bg-primary .navbar-brand,
  .navbar.bg-primary .nav-link { color: #1a3010 !important; }

  .form-control,
  .form-select {
    background: rgba(255, 255, 255, 0.78) !important;
    color: var(--text) !important;
    border-color: rgba(122, 177, 35, 0.32) !important;
  }
  .form-control::placeholder { color: var(--muted); }

  .dropdown-menu { background: rgba(235, 248, 215, 0.92) !important; }
  .dropdown-item { color: var(--text) !important; }

  .table {
    --bs-table-color: var(--text);
    color: var(--text);
  }
  .table thead th,
  .table-light thead,
  thead.table-light {
    background: rgba(154, 205, 50, 0.14) !important;
    color: #44521a !important;
  }

  .alert-success { color: #14532d !important; }
  .alert-danger  { color: #7f1d1d !important; }
  .alert-warning { color: #78350f !important; }
  .btn-close { filter: none; }

  .btn-outline-primary {
    color: var(--accent-strong);
    border-color: rgba(122, 177, 35, 0.65);
    background: rgba(154, 205, 50, 0.16);
  }
  .btn-outline-primary:hover,
  .btn-outline-primary:focus {
    color: var(--on-accent);
    border-color: var(--accent);
    background: rgba(154, 205, 50, 0.30);
  }
  .btn-outline-secondary {
    color: var(--text);
    border-color: rgba(90, 112, 64, 0.45);
    background: rgba(90, 112, 64, 0.10);
  }
  .btn-outline-secondary:hover,
  .btn-outline-secondary:focus {
    color: #1a3010;
    background: rgba(90, 112, 64, 0.20);
    border-color: rgba(90, 112, 64, 0.75);
  }
  .btn-outline-success {
    color: #15803d;
    border-color: rgba(21, 128, 61, 0.52);
    background: rgba(21, 128, 61, 0.11);
  }
  .btn-outline-success:hover,
  .btn-outline-success:focus {
    color: #052e16;
    background: rgba(21, 128, 61, 0.22);
    border-color: rgba(21, 128, 61, 0.85);
  }
  .btn-outline-danger {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.52);
    background: rgba(185, 28, 28, 0.10);
  }
  .btn-outline-danger:hover,
  .btn-outline-danger:focus {
    color: #450a0a;
    background: rgba(185, 28, 28, 0.22);
    border-color: rgba(185, 28, 28, 0.85);
  }
  .btn-outline-warning {
    color: #92660a;
    border-color: rgba(180, 120, 10, 0.55);
    background: rgba(251, 191, 36, 0.14);
  }
  .btn-outline-warning:hover,
  .btn-outline-warning:focus {
    color: #451a03;
    background: rgba(251, 191, 36, 0.26);
    border-color: rgba(180, 120, 10, 0.85);
  }

  .modal-backdrop {
    background-color: rgba(60, 90, 30, 0.35) !important;
  }
  .modal-content {
    background: var(--gl-specular), rgba(240, 252, 220, 0.82);
    border-color: rgba(122, 177, 35, 0.30);
    box-shadow:
      0 4px 16px  rgba(60, 100, 10, 0.18),
      0 28px 80px rgba(60, 100, 10, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }
  .modal-header {
    background: linear-gradient(180deg,
      rgba(154, 205, 50, 0.16) 0%,
      transparent 100%);
    border-bottom-color: rgba(122, 177, 35, 0.22);
  }
  .modal-footer {
    border-top-color: rgba(122, 177, 35, 0.16);
    background: rgba(255, 255, 255, 0.18);
  }
}

/* =====================================================
   Explicit light theme override  [data-theme="light"]
   ===================================================== */
:root[data-theme="light"] {
  --bg:    #eef7e0;
  --text:  #1a3010;
  --muted: #5a7040;
  --surface:          rgba(255, 255, 255, 0.68);
  --gl-blur:          blur(20px) saturate(160%) brightness(1.02);
  --gl-border-accent: rgba(122, 177, 35, 0.28);
  --gl-border-white:  rgba(255, 255, 255, 0.55);
  --gl-shadow:
    0 2px 6px  rgba(90, 130, 20, 0.10),
    0 12px 40px rgba(90, 130, 20, 0.14);
  --gl-inset:    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  --gl-specular: linear-gradient(165deg,
      rgba(255,255,255,0.55) 0%,
      rgba(255,255,255,0.15) 55%,
      rgba(255,255,255,0.03) 100%);
}

:root[data-theme="light"] .btn-outline-warning {
  color: #92660a;
  border-color: rgba(180, 120, 10, 0.55);
  background: rgba(251, 191, 36, 0.14);
}
:root[data-theme="light"] .btn-outline-warning:hover,
:root[data-theme="light"] .btn-outline-warning:focus {
  color: #451a03;
  background: rgba(251, 191, 36, 0.26);
  border-color: rgba(180, 120, 10, 0.85);
}

:root[data-theme="light"] .modal-backdrop {
  background-color: rgba(60, 90, 30, 0.35) !important;
}
:root[data-theme="light"] .modal-content {
  background: var(--gl-specular), rgba(240, 252, 220, 0.82);
  border-color: rgba(122, 177, 35, 0.30);
  box-shadow:
    0 4px 16px  rgba(60, 100, 10, 0.18),
    0 28px 80px rgba(60, 100, 10, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
:root[data-theme="light"] .modal-header {
  background: linear-gradient(180deg,
    rgba(154, 205, 50, 0.16) 0%,
    transparent 100%);
  border-bottom-color: rgba(122, 177, 35, 0.22);
}
:root[data-theme="light"] .modal-footer {
  border-top-color: rgba(122, 177, 35, 0.16);
  background: rgba(255, 255, 255, 0.18);
}

:root[data-theme="light"] .btn-outline-primary {
  color: var(--accent-strong);
  border-color: rgba(122, 177, 35, 0.65);
  background: rgba(154, 205, 50, 0.16);
}
:root[data-theme="light"] .btn-outline-primary:hover,
:root[data-theme="light"] .btn-outline-primary:focus {
  color: var(--on-accent);
  border-color: var(--accent);
  background: rgba(154, 205, 50, 0.30);
}
:root[data-theme="light"] .btn-outline-secondary {
  color: var(--text);
  border-color: rgba(90, 112, 64, 0.45);
  background: rgba(90, 112, 64, 0.10);
}
:root[data-theme="light"] .btn-outline-secondary:hover,
:root[data-theme="light"] .btn-outline-secondary:focus {
  color: #1a3010;
  background: rgba(90, 112, 64, 0.20);
  border-color: rgba(90, 112, 64, 0.75);
}
:root[data-theme="light"] .btn-outline-success {
  color: #15803d;
  border-color: rgba(21, 128, 61, 0.52);
  background: rgba(21, 128, 61, 0.11);
}
:root[data-theme="light"] .btn-outline-success:hover,
:root[data-theme="light"] .btn-outline-success:focus {
  color: #052e16;
  background: rgba(21, 128, 61, 0.22);
  border-color: rgba(21, 128, 61, 0.85);
}
:root[data-theme="light"] .btn-outline-danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.52);
  background: rgba(185, 28, 28, 0.10);
}
:root[data-theme="light"] .btn-outline-danger:hover,
:root[data-theme="light"] .btn-outline-danger:focus {
  color: #450a0a;
  background: rgba(185, 28, 28, 0.22);
  border-color: rgba(185, 28, 28, 0.85);
}


