/* =====================================================================
   ระบบจัดการการแข่งขันศิลปหัตถกรรมนักเรียน ครั้งที่ 74
   ===================================================================== */
:root {
  --brand-navy: #1b2f6b;
  --brand-navy-2: #2a46a3;
  --brand-gold: #d4a017;
  --brand-gold-soft: #f6e7b4;
  --medal-gold: #d4a017;
  --medal-silver: #a8a9ad;
  --medal-bronze: #b87333;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --border-soft: rgba(27, 47, 107, .08);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --radius: 14px;
  --sidebar-w: 268px;

  --bs-primary: #2a46a3;
  --bs-primary-rgb: 42, 70, 163;
  --bs-link-color: #2a46a3;
  --bs-link-color-rgb: 42, 70, 163;
  --bs-body-font-family: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-bg: var(--surface-2);
}

[data-bs-theme="dark"] {
  --surface: #182033;
  --surface-2: #0f1524;
  --border-soft: rgba(255, 255, 255, .08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
  --bs-body-bg: var(--surface-2);
  --bs-link-color: #8fa8ff;
  --bs-link-color-rgb: 143, 168, 255;
  --bs-primary-rgb: 110, 140, 240;
}

body { background: var(--bs-body-bg); }
h1, h2, h3, .h1, .h2, .h3, .hero-title, .section-title, .page-title, .brand-text strong { font-family: 'Prompt', var(--bs-body-font-family); }

.btn-primary { --bs-btn-bg: var(--brand-navy-2); --bs-btn-border-color: var(--brand-navy-2); --bs-btn-hover-bg: var(--brand-navy); --bs-btn-hover-border-color: var(--brand-navy); --bs-btn-active-bg: var(--brand-navy); }
.btn-gold { --bs-btn-bg: var(--brand-gold); --bs-btn-color: #1c1c1c; --bs-btn-border-color: var(--brand-gold); --bs-btn-hover-bg: #c2910f; --bs-btn-hover-color: #111; --bs-btn-hover-border-color: #c2910f; --bs-btn-active-bg: #b0840e; font-weight: 600; }
.btn-icon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 0; background: transparent; color: inherit; }
.btn-icon:hover { background: rgba(127, 127, 127, .12); }
.bg-gold { background-color: var(--brand-gold) !important; }
.text-gold { color: var(--brand-gold) !important; }
.min-w-0 { min-width: 0; }
.skip-link { position: absolute; z-index: 2000; top: 8px; left: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; }

.card { border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--border-soft); font-weight: 600; padding: .9rem 1.1rem; }
.card-header .bi { color: var(--brand-gold); margin-right: .25rem; }
.list-group-item { background: transparent; }

/* ---------- Header หน้าบ้าน ---------- */
.site-header { background: var(--surface); box-shadow: var(--shadow-sm); }
.topbar { background: var(--brand-navy); color: #dfe6ff; font-size: .85rem; padding: .35rem 0; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { color: var(--brand-gold); }
/* ปุ่มเครื่องมือบนแถบบนสุด (รูปแบบเมนู / โหมดสว่าง-มืด / เข้าสู่ระบบ) */
.topbar .btn-topbar { width: 32px; height: 32px; border-radius: 8px; color: #fff; }
.topbar .btn-topbar:hover { background: rgba(255, 255, 255, .15); color: var(--brand-gold); }
.topbar .btn-gold { color: #1c1c1c; padding: .15rem .65rem; font-size: .82rem; }
.topbar .btn-gold:hover { color: #111; }
.topbar .dropdown-menu { font-size: .9rem; }
.main-nav { padding: .5rem 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { color: var(--brand-navy); font-size: 1rem; }
[data-bs-theme="dark"] .brand-text strong { color: #fff; }
.brand-text small { color: var(--bs-secondary-color); font-size: .78rem; }
.main-nav .nav-link { font-weight: 500; border-radius: 8px; padding: .5rem .7rem !important; white-space: nowrap; }
.main-nav .btn { white-space: nowrap; }
.main-nav .navbar-brand { margin-right: .75rem; }
@media (min-width: 1200px) {
  /* เมนูแนวนอน: ซ่อนไอคอนของเมนูหลักเพื่อให้อยู่บรรทัดเดียว (ไอคอนยังแสดงในเมนูมือถือและเมนูย่อย) */
  .site-header .container { max-width: 1480px; }
  .main-nav .navbar-nav > .nav-item > .nav-link > .bi { display: none; }
  .main-nav .nav-link { padding: .5rem .55rem !important; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .main-nav .nav-link { font-size: .92rem; padding: .5rem .4rem !important; }
  .brand-text small { display: none; }
}
.main-nav .nav-link.active, .main-nav .nav-link:hover { color: var(--brand-navy-2); background: rgba(42, 70, 163, .08); }
[data-bs-theme="dark"] .main-nav .nav-link.active, [data-bs-theme="dark"] .main-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.dropdown-menu { border-radius: 12px; border-color: var(--border-soft); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--brand-navy-2); }
.menu-scroll { max-height: 70vh; overflow-y: auto; }
/* สลับเมนูระดับเขตพื้นที่ / ระดับเครือข่าย */
.level-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(42, 70, 163, .08); gap: 2px; }
.level-switch a { padding: .3rem .75rem; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--brand-navy-2); text-decoration: none; white-space: nowrap; }
.level-switch a:hover { background: rgba(42, 70, 163, .12); }
.level-switch a.active { background: var(--brand-navy-2); color: #fff; }
[data-bs-theme="dark"] .level-switch { background: rgba(255, 255, 255, .08); }
[data-bs-theme="dark"] .level-switch a { color: #dfe6ff; }
[data-bs-theme="dark"] .level-switch a.active { background: var(--brand-gold); color: #1c1c1c; }
.front-sidebar .level-switch { display: flex; margin: 0 .5rem .75rem; }
.front-sidebar .level-switch a { flex: 1; text-align: center; }
@media (min-width: 1200px) and (max-width: 1399.98px) { .main-nav .level-switch a { padding: .3rem .5rem; font-size: .82rem; } }
@media (max-width: 1199.98px) {
  .main-nav .dropdown-menu { box-shadow: none !important; border: 0; padding-left: 1rem; }
}

/* เมนู 2 ชั้น (.dropdown-submenu): จอกว้างเปิดด้านข้างเมื่อชี้/คลิก, จอแคบกางลงด้านล่างเมื่อคลิก */
.submenu-toggle { display: flex; align-items: center; }
.submenu-caret { font-size: .75rem; margin-left: .75rem; transition: transform .2s; }
.dropdown-submenu > .submenu { display: none; }
.dropdown-submenu.show > .submenu { display: block; }
@media (min-width: 1200px) {
  .dropdown-submenu { position: relative; }
  .dropdown-submenu > .submenu { position: absolute; top: -.4rem; left: 100%; margin: 0 0 0 .15rem; min-width: 15rem; max-height: 75vh; overflow-y: auto; }
  .dropdown-submenu:hover > .submenu { display: block; }
  .dropdown-submenu:hover > .submenu-toggle { background: var(--bs-dropdown-link-hover-bg); }
  .has-submenu.submenu-left .dropdown-submenu > .submenu { left: auto; right: 100%; margin: 0 .15rem 0 0; }
  .has-submenu.submenu-left .submenu-caret { transform: rotate(180deg); }
}
@media (max-width: 1199.98px) {
  .dropdown-submenu.show > .submenu-toggle .submenu-caret { transform: rotate(90deg); }
}
.anchor-target { scroll-margin-top: calc(var(--front-header-h, 96px) + 1rem); }
.anchor-target:target { outline: 2px solid var(--brand-gold); outline-offset: 2px; }

/* รูปแบบเมนูหน้าบ้าน: ด้านบน (ค่าเริ่มต้น) / ด้านซ้าย / ด้านขวา — มีผลเฉพาะจอกว้าง */
.front-sidebar { display: none; }
@media (min-width: 1200px) {
  .front.menu-left .front-shell, .front.menu-right .front-shell { display: flex; align-items: flex-start; }
  .front.menu-right .front-shell { flex-direction: row-reverse; }
  .front.menu-left .front-shell > main, .front.menu-right .front-shell > main { flex: 1; min-width: 0; }
  .front.menu-left .main-nav .navbar-nav > .nav-item:not(.nav-tools),
  .front.menu-right .main-nav .navbar-nav > .nav-item:not(.nav-tools) { display: none; }
  .front.menu-left .front-sidebar, .front.menu-right .front-sidebar {
    display: block; flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
    position: sticky; top: var(--front-header-h, 96px); max-height: calc(100vh - var(--front-header-h, 96px)); overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--border-soft);
  }
  .front.menu-right .front-sidebar { border-right: 0; border-left: 1px solid var(--border-soft); }
}
.front-side-nav { padding: .5rem .75rem 1.5rem; }
.side-group { font-size: .75rem; letter-spacing: .03em; color: var(--bs-secondary-color); margin: 1rem .6rem .35rem; font-weight: 600; }
.side-group .bi { color: var(--brand-gold); }
.side-link { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .5rem .75rem; border: 0; border-radius: 10px; background: transparent; color: var(--bs-body-color); text-decoration: none; font-size: .93rem; text-align: left; margin-bottom: 2px; }
.side-link > .bi:first-child { font-size: 1.05rem; width: 1.2rem; text-align: center; color: var(--brand-navy-2); }
[data-bs-theme="dark"] .side-link > .bi:first-child { color: #8fa8ff; }
.side-link:hover { background: rgba(42, 70, 163, .08); color: var(--bs-body-color); }
.side-link.active { background: var(--brand-navy-2); color: #fff; font-weight: 600; }
.side-link.active > .bi:first-child { color: #fff; }
.side-link.disabled { opacity: .55; pointer-events: none; }
.side-caret { margin-left: auto; font-size: .8rem; transition: transform .2s; }
.side-toggle:not(.collapsed) .side-caret { transform: rotate(180deg); }
.side-sub { padding-left: 1.6rem; }
.side-sub .side-link { font-size: .87rem; padding: .4rem .7rem; }
.side-sub .side-leaf { font-size: .82rem; padding: .3rem .7rem .3rem 1.4rem; color: var(--bs-secondary-color); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; padding: 3.5rem 0 5.5rem;
  background:
    radial-gradient(circle at 85% 20%, rgba(212, 160, 23, .35), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(99, 132, 255, .35), transparent 45%),
    linear-gradient(135deg, #142356 0%, #1f3a8a 55%, #2a46a3 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 22px 22px;
}
.hero-badge { display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); font-size: .9rem; }
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.25; margin: 1rem 0 .5rem; }
.hero-sub { font-size: 1.1rem; opacity: .9; }
.hero-meta li { margin-bottom: .35rem; opacity: .95; }
.hero-meta .bi { color: var(--brand-gold); margin-right: .4rem; }

/* ---------- ธีมสีประจำอำเภอ (ระดับศูนย์) ----------
   --dt-dark / --dt-main = ไล่สีพื้นหลัง, --dt-accent = สีเน้น (ปุ่ม/แถบ/ไอคอน), --dt-on = สีตัวอักษรบน accent */
.dtheme-1 { --dt-dark: #0b3d36; --dt-main: #0f8a78; --dt-accent: #2fd1b4; --dt-on: #04211d; }  /* เขียวมรกต */
.dtheme-2 { --dt-dark: #2e1659; --dt-main: #6a35b5; --dt-accent: #c9a6ff; --dt-on: #1d0b3a; }  /* ม่วง */
.dtheme-3 { --dt-dark: #4f1020; --dt-main: #a8283e; --dt-accent: #ff9aa9; --dt-on: #3a0812; }  /* แดงเลือดหมู */
.dtheme-4 { --dt-dark: #5a2a05; --dt-main: #c25e10; --dt-accent: #ffc27a; --dt-on: #3b1a02; }  /* ส้มอิฐ */
.dtheme-5 { --dt-dark: #0a3a57; --dt-main: #0b7fb8; --dt-accent: #7fd4ff; --dt-on: #04263a; }  /* ฟ้าน้ำทะเล */
.dtheme-6 { --dt-dark: #5a1145; --dt-main: #b8337f; --dt-accent: #ffa3d6; --dt-on: #3a0a2c; }  /* ชมพู */

.district-theme .hero {
  background:
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--dt-accent) 40%, transparent), transparent 42%),
    radial-gradient(circle at 10% 90%, color-mix(in srgb, var(--dt-main) 60%, transparent), transparent 45%),
    linear-gradient(135deg, var(--dt-dark) 0%, var(--dt-main) 100%);
}
.district-theme .hero .text-gold, .district-theme .countdown-grid span { color: var(--dt-accent) !important; }
.district-theme .hero .btn-gold { --bs-btn-bg: var(--dt-accent); --bs-btn-border-color: var(--dt-accent); --bs-btn-color: var(--dt-on);
  --bs-btn-hover-bg: color-mix(in srgb, var(--dt-accent) 85%, #fff); --bs-btn-hover-border-color: var(--bs-btn-hover-bg); --bs-btn-hover-color: var(--dt-on); }
.district-theme .progress-card { border-top: 4px solid var(--dt-main); }
.district-theme .bg-gold { background-color: var(--dt-main) !important; color: #fff; }
.district-theme .text-gold { color: var(--dt-main) !important; }
.district-theme .card-header .bi, .district-theme .section-title .bi, .district-theme .progress-card .text-gold { color: var(--dt-main) !important; }
[data-bs-theme="dark"] .district-theme .card-header .bi, [data-bs-theme="dark"] .district-theme .section-title .bi { color: var(--dt-accent) !important; }
.district-theme .venue-no { background: var(--dt-main); }
.district-theme .page-head { background: linear-gradient(135deg, var(--dt-dark), var(--dt-main)); }
.district-theme .district-switch a.active { background: var(--dt-accent); border-color: var(--dt-accent); color: var(--dt-on); }
/* จุดสีประจำอำเภอบนปุ่มสลับ */
.district-switch a[class*="dtheme-"]::before, .district-dot::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; background: var(--dt-accent); vertical-align: .05rem; }
/* หลังบ้าน: แถบหัว Dashboard อำเภอ */
.district-banner { background: linear-gradient(120deg, var(--dt-dark), var(--dt-main)); color: #fff; border-radius: var(--radius); padding: 1rem 1.25rem; }
.district-banner .btn-outline-light.active, .district-banner .btn-light { background: var(--dt-accent); border-color: var(--dt-accent); color: var(--dt-on); }
.district-theme .stat-card { border-top: 3px solid var(--dt-main); }
.district-theme .card:not(.progress-card) { border-top: 3px solid var(--dt-main); }
.district-theme .btn-primary { --bs-btn-bg: var(--dt-main); --bs-btn-border-color: var(--dt-main); --bs-btn-hover-bg: var(--dt-dark); --bs-btn-hover-border-color: var(--dt-dark); --bs-btn-active-bg: var(--dt-dark); }
.district-theme .btn-outline-primary { --bs-btn-color: var(--dt-main); --bs-btn-border-color: var(--dt-main); --bs-btn-hover-bg: var(--dt-main); --bs-btn-hover-border-color: var(--dt-main); --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .district-theme .btn-outline-primary { --bs-btn-color: var(--dt-accent); --bs-btn-border-color: var(--dt-accent); }

.district-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.district-switch a { color: #fff; text-decoration: none; font-size: .9rem; padding: .2rem .75rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); }
.district-switch a:hover { background: rgba(255, 255, 255, .18); }
.district-switch a.active { background: var(--brand-gold); border-color: var(--brand-gold); color: #1c1c1c; font-weight: 600; }
.countdown-card { background: rgba(255, 255, 255, .1); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .2); border-radius: 20px; padding: 1.5rem; text-align: center; position: relative; z-index: 1; }
.countdown-label { font-size: .95rem; opacity: .85; margin-bottom: .75rem; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.countdown-grid div { background: rgba(0, 0, 0, .18); border-radius: 14px; padding: .8rem .2rem; }
.countdown-grid span { display: block; font-family: 'Prompt', sans-serif; font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; color: var(--brand-gold); font-variant-numeric: tabular-nums; }
.countdown-grid small { opacity: .85; }
.countdown-done { font-size: 1.4rem; font-weight: 600; color: var(--brand-gold); }

/* ---------- Stat cards ---------- */
.stats-section { margin-top: -3.5rem; position: relative; z-index: 2; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow-md); border: 1px solid var(--border-soft); height: 100%; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--accent); opacity: .08; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); margin-bottom: .6rem; }
.stat-value { font-family: 'Prompt', sans-serif; font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--bs-secondary-color); font-size: .9rem; }
/* การ์ดสถิติที่คลิกไปหน้ารายการได้ */
a.stat-link { display: block; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.stat-link:hover, a.stat-link:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(16, 24, 40, .14); color: inherit; }
a.stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stat-more { font-size: .75rem; opacity: .45; transition: opacity .15s ease, transform .15s ease; display: inline-block; }
a.stat-link:hover .stat-more { opacity: 1; color: var(--accent); transform: translateX(2px); }
.stat-blue { --accent: #2a6df4; } .stat-indigo { --accent: #5b4bdb; } .stat-teal { --accent: #0f9d8a; }
.stat-orange { --accent: #e67e22; } .stat-pink { --accent: #d6336c; } .stat-purple { --accent: #8e44ad; }

.progress-lg { height: 1.6rem; border-radius: 999px; font-weight: 600; }
.progress-lg .progress-bar { color: #1c1c1c; }

/* ---------- Sections ---------- */
.section { margin-top: 1.75rem; }
.section-title { font-size: 1.35rem; font-weight: 600; margin-bottom: 1rem; }
.section-title .bi { color: var(--brand-gold); }
.page-head { background: linear-gradient(135deg, #142356, #2a46a3); color: #fff; padding: 2rem 0 1.75rem; }
.page-head .breadcrumb-item, .page-head .breadcrumb-item a, .page-head .breadcrumb-item.active { color: rgba(255, 255, 255, .8); }
.page-head .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .5); }
.chart-box { position: relative; height: 320px; }
.chart-box-tall { height: 460px; }
.empty-state { text-align: center; color: var(--bs-secondary-color); padding: 2rem 1rem; }
.empty-state > .bi { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .5; }

.venue-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); position: relative; transition: transform .15s, box-shadow .15s; }
.venue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.venue-no { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-navy-2); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: .75rem; }

.medal { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.medal-lg { width: 34px; height: 34px; }
.medal-gold { background: radial-gradient(circle at 35% 35%, #ffe680, var(--medal-gold)); }
.medal-silver { background: radial-gradient(circle at 35% 35%, #f2f2f2, var(--medal-silver)); }
.medal-bronze { background: radial-gradient(circle at 35% 35%, #f0b88a, var(--medal-bronze)); }

.site-footer { background: #0f1a40; color: #c9d3f5; padding: 2.5rem 0 1.5rem; margin-top: 2rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--brand-gold); }
.site-footer hr { border-color: rgba(255, 255, 255, .15); }

/* ทีมผู้พัฒนาระบบ (/developers) */
.dev-intro { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border-soft); border-left: 5px solid var(--brand-gold); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.dev-intro-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #142356, #2a46a3); color: var(--brand-gold); font-size: 1.6rem; }
.dev-intro-count { flex: none; text-align: center; padding-left: 1rem; border-left: 1px solid var(--border-soft); }
.dev-intro-count strong { display: block; font-family: 'Prompt', sans-serif; font-size: 1.8rem; line-height: 1.1; color: var(--brand-gold); }
.dev-intro-count small { color: var(--bs-secondary-color); }
.dev-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.5rem 1.25rem 1.25rem; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.dev-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 64px; background: linear-gradient(135deg, #142356, #2a46a3); }
.dev-card-featured::before { height: 76px; background: linear-gradient(135deg, #142356, #2a46a3 60%, var(--brand-gold)); }
.dev-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dev-photo { position: relative; width: 104px; height: 104px; border-radius: 50%; padding: 4px; background: var(--brand-gold); box-shadow: 0 4px 14px rgba(16, 24, 40, .18); margin-bottom: .85rem; }
.dev-card-featured .dev-photo { width: 124px; height: 124px; }
.dev-photo img, .dev-photo span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center top; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 3px solid var(--surface); }
.dev-photo span .bi { font-size: 2.6rem; color: var(--bs-secondary-color); opacity: .6; }
.dev-name { font-size: 1.05rem; font-weight: 600; margin-bottom: .35rem; }
.dev-role { display: inline-block; font-size: .8rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px; background: var(--brand-gold-soft); color: #6b4f00; margin-bottom: .5rem; }
[data-bs-theme="dark"] .dev-role { background: rgba(212, 160, 23, .18); color: var(--brand-gold); }
.dev-org { font-size: .88rem; color: var(--bs-secondary-color); margin-bottom: .5rem; }
.dev-org span { display: block; }
.dev-duties { list-style: none; padding: .75rem 0 0; margin: .25rem 0 0; width: 100%; border-top: 1px dashed var(--border-soft); text-align: left; font-size: .87rem; }
.dev-duties li { display: flex; gap: .45rem; margin-bottom: .3rem; }
.dev-duties .bi { color: var(--brand-navy-2); flex: none; margin-top: .1rem; }
[data-bs-theme="dark"] .dev-duties .bi { color: var(--brand-gold); }
.dev-contact { display: flex; justify-content: center; gap: .35rem; margin-top: auto; padding-top: .75rem; }
.dev-contact .btn-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); color: var(--brand-navy-2); }
.dev-contact .btn-icon:hover { background: var(--brand-navy-2); color: #fff; }
[data-bs-theme="dark"] .dev-contact .btn-icon { color: var(--brand-gold); }
@media (max-width: 575.98px) {
  .dev-intro { flex-wrap: wrap; }
  .dev-intro-count { width: 100%; padding: .75rem 0 0; border-left: 0; border-top: 1px solid var(--border-soft); }
}

/* ปุ่มลอยมุมขวาล่าง: เลือกเครือข่าย (หน้า /networks*) / เมนูทางลัด (หน้าระดับเขต — partials/quick-fab) */
.float-nav { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040; }
.float-nav-btn { width: 58px; height: 58px; border: 3px solid var(--brand-gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #142356, #2a46a3); color: var(--brand-gold); font-size: 1.5rem; box-shadow: 0 8px 22px rgba(15, 26, 64, .35); transition: transform .15s, box-shadow .15s; }
.float-nav-btn:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 28px rgba(15, 26, 64, .45); }
.float-nav-btn:focus-visible { outline: 3px solid var(--brand-gold-soft); outline-offset: 2px; }
.float-nav-btn[aria-expanded="true"] { background: var(--brand-gold); color: #142356; border-color: #fff; }
.float-nav-menu { min-width: 280px; max-width: calc(100vw - 2rem); border-radius: var(--radius); padding: .4rem; }
.float-nav-menu .dropdown-item { border-radius: 8px; white-space: normal; }
.float-nav-list { max-height: min(60vh, 26rem); overflow-y: auto; }
@media (max-width: 575.98px) { .float-nav { right: 1rem; bottom: 1rem; } .float-nav-btn { width: 52px; height: 52px; font-size: 1.35rem; } }

/* ตัวนับผู้เข้าชม (footer) */
.visitor-counter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin-top: 1.75rem; padding: 1rem 1.25rem; border: 1px solid rgba(212, 160, 23, .35); border-radius: 16px; background: linear-gradient(135deg, rgba(42, 70, 163, .35), rgba(15, 26, 64, .2)); }
.visitor-head { display: flex; align-items: center; gap: .75rem; }
.visitor-head strong { display: block; color: #fff; font-family: 'Prompt', sans-serif; font-weight: 600; }
.visitor-head small { display: block; font-size: .78rem; opacity: .75; }
.visitor-icon { width: 42px; height: 42px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-gold); color: #1c1c1c; font-size: 1.3rem; }
.visitor-odometer { display: flex; gap: .3rem; }
.visitor-odometer span { width: 2rem; height: 2.7rem; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: linear-gradient(180deg, #1b2f6b 0 49%, #142356 51% 100%); box-shadow: inset 0 0 0 1px rgba(212, 160, 23, .45), 0 2px 6px rgba(0, 0, 0, .3); color: var(--brand-gold); font-family: 'Prompt', sans-serif; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; animation: visitor-roll .6s cubic-bezier(.2, .8, .3, 1.2) both; animation-delay: calc(var(--i) * 70ms); }
.visitor-stats { display: grid; grid-template-columns: repeat(4, auto); gap: .25rem 1.25rem; margin: 0; text-align: center; }
.visitor-stats dt { font-size: .75rem; font-weight: 400; opacity: .75; }
.visitor-stats dd { margin: 0; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes visitor-roll { from { transform: translateY(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 767.98px) {
  .visitor-counter { justify-content: center; text-align: center; }
  .visitor-head { width: 100%; justify-content: center; text-align: left; }
  .visitor-odometer span { width: 1.75rem; height: 2.4rem; font-size: 1.3rem; }
  .visitor-stats { width: 100%; grid-template-columns: repeat(4, 1fr); gap: .25rem .5rem; }
}
@media (prefers-reduced-motion: reduce) { .visitor-odometer span { animation: none; } }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; background: radial-gradient(circle at 80% 10%, rgba(212, 160, 23, .3), transparent 40%), linear-gradient(135deg, #142356, #2a46a3); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 20px; padding: 2rem 1.75rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.password-toggle { position: absolute; right: .25rem; top: .55rem; z-index: 5; color: var(--bs-secondary-color); }
.error-code { font-family: 'Prompt', sans-serif; font-size: 3rem; font-weight: 700; color: var(--brand-navy-2); }
.error-detail { max-height: 320px; overflow: auto; font-size: .75rem; background: var(--surface-2); padding: 1rem; border-radius: 8px; }
/* ลงนามอิเล็กทรอนิกส์ (/sign/...) — กรอบเซ็นเป็นพื้นขาวเสมอ ภาพลายเซ็นจะได้ใช้พิมพ์บนกระดาษได้ */
.sign-card { width: 100%; max-width: 640px; min-width: 0; border-radius: 20px; }
.sign-pad { display: block; width: 100%; height: 190px; background: #fff; border: 2px dashed #9aa6c8; border-radius: 12px; touch-action: none; cursor: crosshair; }
.sign-pad.is-invalid { border-color: var(--bs-danger); }

/* ---------- Admin ---------- */
.admin-sidebar {
  background: linear-gradient(180deg, #142356 0%, #1b2f6b 100%); color: #d6ddf5;
  width: var(--sidebar-w) !important; display: flex; flex-direction: column;
}
@media (min-width: 1200px) {
  .admin-sidebar { position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1030; }
  .admin-main { margin-left: var(--sidebar-w); }
}
.sidebar-brand { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-brand a { color: #fff; }
.sidebar-brand strong { display: block; font-size: .95rem; font-family: 'Prompt', sans-serif; }
.sidebar-brand small { color: #aab6e0; font-size: .75rem; }
.sidebar-user { margin: 1rem; padding: .85rem; border-radius: 12px; background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-user small { color: #aab6e0; }
.role-badge { font-size: .75rem; background: var(--brand-gold); color: #1c1c1c; padding: .15rem .55rem; border-radius: 999px; font-weight: 600; }
.sidebar-nav { padding: 0 .75rem 1.5rem; }
.nav-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #8c9bd0; margin: 1rem .6rem .35rem; }
.sidebar-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px; color: #d6ddf5; text-decoration: none; font-size: .93rem; margin-bottom: 2px; }
.sidebar-link .bi { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-link.active { background: var(--brand-gold); color: #1c1c1c; font-weight: 600; }
.sidebar-toggle { width: 100%; border: 0; background: transparent; text-align: left; }
.sidebar-caret { margin-left: auto; font-size: .75rem !important; transition: transform .2s; }
.sidebar-toggle:not(.collapsed) .sidebar-caret { transform: rotate(180deg); }
.sidebar-sub { margin: 0 0 4px 1.1rem; padding-left: .5rem; border-left: 1px solid rgba(255, 255, 255, .12); }
.sidebar-sub .sidebar-link { font-size: .88rem; padding: .4rem .7rem; }

.admin-header { position: sticky; top: 0; z-index: 1020; }
.admin-topbar { display: flex; align-items: center; gap: .5rem; padding: .6rem 1.25rem; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-soft); }
.topbar-brand { display: none; flex-shrink: 0; }
.admin-topnav { display: none; background: linear-gradient(90deg, #142356 0%, #1b2f6b 100%); padding: .35rem 1rem; }
.admin-topnav .nav { flex-wrap: wrap; gap: 2px; }
.admin-topnav .nav-link { color: #d6ddf5; border-radius: 8px; padding: .45rem .8rem; font-size: .93rem; white-space: nowrap; }
.admin-topnav .nav-link:hover, .admin-topnav .nav-link:focus-visible, .admin-topnav .nav-link.show { background: rgba(255, 255, 255, .1); color: #fff; }
.admin-topnav .nav-link.active { background: var(--brand-gold); color: #1c1c1c; font-weight: 600; }
.menu-layout-check { visibility: hidden; }
.menu-layout-option.active .menu-layout-check { visibility: visible; }

/* รูปแบบเมนู (เลือกจากปุ่มบนแถบด้านบน) — มีผลเฉพาะจอกว้าง; จอเล็กใช้เมนูแบบเลื่อนออกเสมอ */
@media (min-width: 1200px) {
  .admin .menu-toggle { display: none; }
  .menu-right .admin-sidebar { inset: 0 0 0 auto; }
  .menu-right .admin-main { margin-left: 0; margin-right: var(--sidebar-w); }
  .menu-top .admin-sidebar { display: none !important; }
  .menu-top .admin-main { margin-left: 0; }
  .menu-top .admin-topnav { display: block; }
  .menu-top .topbar-brand { display: inline-flex; }
}
.page-title { font-size: 1.2rem; font-weight: 600; margin: 0; }
.admin-content { padding: 1.5rem 1.25rem; min-height: calc(100vh - 120px); }
.admin-footer { padding: 1rem 1.25rem; font-size: .8rem; color: var(--bs-secondary-color); }
@media (max-width: 575.98px) {
  .admin-content { padding: 1rem; }
  .stat-value { font-size: 1.3rem; }
}

.district-card { transition: transform .15s, box-shadow .15s; }
.district-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.steps { padding-left: 1.2rem; margin: 0; }
.steps li { margin-bottom: .4rem; }

/* ---------- DataTables ---------- */
div.dt-container .dt-search input { border-radius: 8px; }
div.dt-container .dt-buttons .btn { border-radius: 8px !important; margin-right: .25rem; }
table.dataTable thead th { white-space: nowrap; }
.dt-layout-row:first-child { gap: .5rem; }

/* ---------- ลงทะเบียน ---------- */
.activity-info { display: flex; flex-wrap: wrap; gap: .4rem .6rem; }
.activity-info > span { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 999px; padding: .2rem .7rem; font-size: .88rem; }
.activity-info .bi { color: var(--brand-navy-2); }
[data-bs-theme="dark"] .activity-info .bi { color: var(--brand-gold); }
.picker { border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); height: 100%; display: flex; flex-direction: column; }
.picker-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border-soft); }
.picker-head input { max-width: 180px; }
.picker-list { flex: 1; max-height: 46vh; min-height: 160px; overflow-y: auto; padding: .35rem; }
.picker-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; margin: 0; }
.picker-item:hover { background: var(--surface-2); }
.picker-item.selected { background: rgba(42, 70, 163, .1); font-weight: 500; }
.picker-item.disabled { opacity: .45; cursor: not-allowed; }
.picker-item small { margin-left: auto; color: var(--bs-secondary-color); }
.picker-foot { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-top: 1px solid var(--border-soft); }
.photo-thumb { width: 36px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
/* ป้ายประชาสัมพันธ์ (Popup) หน้าแรก */
.site-popup-img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: var(--surface-2); }
.site-popup-close { position: absolute; top: .6rem; right: .6rem; z-index: 5; background-color: #fff; border-radius: 50%; padding: .5rem; opacity: .9; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.site-popup .carousel-indicators { position: static; margin: .4rem 0 0; }
.site-popup .carousel-indicators [data-bs-target] { background-color: var(--bs-secondary-color); }
.site-popup .carousel-control-prev, .site-popup .carousel-control-next { height: 60%; top: 20%; filter: drop-shadow(0 0 3px rgba(0, 0, 0, .7)); }
.photo-preview { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-soft); background: var(--surface-2); }
.banner-thumb { width: 128px; height: 72px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border-soft); background: var(--surface-2); }
.photo-preview-wide { width: 192px; height: 108px; object-fit: contain; flex-shrink: 0; }

/* ---------- หน้าข้อมูล ---------- */
.chip-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--surface); color: inherit; text-decoration: none; font-size: .9rem; }
.chip:hover { border-color: var(--brand-navy-2); }
.chip.active { background: var(--brand-navy-2); border-color: var(--brand-navy-2); color: #fff; }
.venue-map { display: block; width: 100%; height: 100%; min-height: 280px; border: 0; border-radius: var(--radius) 0 0 var(--radius); }
.venue-map-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; background: var(--surface-2); color: var(--bs-secondary-color); font-size: 1rem; }
.venue-map-empty .bi { font-size: 2.5rem; }
@media (max-width: 991.98px) { .venue-map { border-radius: var(--radius) var(--radius) 0 0; min-height: 240px; } }
.committee-list { margin: 0; padding-left: 1.4rem; }
.committee-list li { padding: .3rem 0; border-bottom: 1px dashed var(--border-soft); }
.committee-role { float: right; font-size: .85rem; color: var(--brand-navy-2); font-weight: 500; }
[data-bs-theme="dark"] .committee-role { color: var(--brand-gold); }
.news-card { transition: transform .15s, box-shadow .15s; }
.news-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.news-body { font-size: 1.05rem; line-height: 1.8; overflow-wrap: anywhere; }
/* ไฟล์แนบที่แสดงในหน้าข่าว (รูปภาพ / PDF) */
.news-preview img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 10px; border: 1px solid var(--border-soft); }
.news-preview-pdf { border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.news-preview-pdf iframe { display: block; width: 100%; height: 80vh; min-height: 480px; border: 0; }
.verify-photo { width: 120px; height: 160px; object-fit: cover; border-radius: 12px; border: 3px solid var(--brand-gold); background: var(--surface-2); }

/* ---------- ผลการแข่งขัน ---------- */
.medal-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.medal-badge.gold { background: linear-gradient(135deg, #ffe680, #d4a017); color: #3a2c00; }
.medal-badge.silver { background: linear-gradient(135deg, #f4f4f4, #a8a9ad); color: #2b2b2b; }
.medal-badge.bronze { background: linear-gradient(135deg, #f0b88a, #b87333); color: #2e1606; }
.medal-badge.participant { background: var(--surface-2); color: var(--bs-secondary-color); border: 1px solid var(--border-soft); }
.text-bg-bronze { background: #b87333 !important; color: #fff !important; }
.rank-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; padding: 0 .4rem; border-radius: 999px; background: var(--surface-2); font-weight: 700; }
.rank-chip.rank-1 { background: linear-gradient(135deg, #ffe680, #d4a017); color: #3a2c00; }
.rank-chip.rank-2 { background: linear-gradient(135deg, #f4f4f4, #a8a9ad); color: #2b2b2b; }
.rank-chip.rank-3 { background: linear-gradient(135deg, #f0b88a, #b87333); color: #2e1606; }
.score-grid .score-input { font-size: 1.15rem; font-weight: 600; text-align: center; }
.score-grid tr.row-absent td { opacity: .55; background: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(127, 127, 127, .06) 6px, rgba(127, 127, 127, .06) 12px); }
.report-card { transition: transform .15s, box-shadow .15s; }
.report-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon.stat-teal { --accent: #0f9d8a; }

/* ---------- ตั้งค่าเกียรติบัตร ---------- */
.asset-box { border: 1px solid var(--border-soft); border-radius: 12px; padding: .75rem; height: 100%; }
.asset-preview { height: 120px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.asset-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset-preview.is-sig { background: repeating-conic-gradient(#eef0f5 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.style-group { border: 1px solid var(--border-soft); border-radius: 10px; padding: .5rem .75rem; margin-bottom: .5rem; }
.style-group > summary { cursor: pointer; font-weight: 500; }
.style-group[open] { background: var(--surface-2); }
.style-num .form-range { min-width: 6rem; }
.style-preview { position: sticky; top: 1rem; }
.style-frame-wrap { aspect-ratio: 297 / 210; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-md); background: #fff; }
.style-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }

.sticky-actions { position: sticky; bottom: 0; z-index: 10; margin-top: 1.5rem; padding: .85rem 0; background: linear-gradient(to top, var(--bs-body-bg) 70%, transparent); }
.audit-json { max-height: 50vh; overflow: auto; font-size: .78rem; background: var(--surface-2); padding: .75rem; border-radius: 8px; }
.checkbox-group.is-invalid { outline: 1px solid var(--bs-danger); border-radius: 6px; }

/* ---------- หน้าแรก: ช่วงเวลาสำคัญ / ทางลัด / อำเภอ / วันแข่งขัน ---------- */
.period-item { --pc: var(--bs-secondary-color); background: var(--surface); border: 1px solid var(--border-soft); border-left: 4px solid var(--pc); border-radius: 10px; padding: .7rem .85rem; height: 100%; box-shadow: var(--shadow-sm); font-size: .92rem; }
.period-item .period-icon, .period-item .period-state { color: var(--pc); }
.period-item .period-state { font-weight: 600; font-size: .85rem; }
.period-open { --pc: var(--bs-success); background: color-mix(in srgb, var(--bs-success) 7%, var(--surface)); }
.period-upcoming { --pc: var(--bs-primary); }
.period-closed { --pc: var(--bs-secondary-color); opacity: .8; }
.period-unset { --pc: var(--bs-tertiary-color); opacity: .7; }

.shortcut-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; height: 100%; min-height: 104px; padding: .8rem .5rem; text-align: center;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.shortcut-tile > .bi { font-size: 1.6rem; color: var(--brand-navy-2); }
.shortcut-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-navy-2); color: inherit; }
.shortcut-label { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.shortcut-note { font-size: .75rem; color: var(--bs-secondary-color); }
.shortcut-tile.is-off { opacity: .55; box-shadow: none; }
.shortcut-tile.is-off > .bi { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .shortcut-tile > .bi { color: #8fa8ff; }
.district-theme .shortcut-tile > .bi { color: var(--dt-main); }

.manual-hero { border-left: 5px solid var(--brand-gold); background: linear-gradient(90deg, color-mix(in srgb, var(--brand-gold) 10%, var(--surface)), var(--surface) 60%); }
.manual-hero-icon { font-size: 2.6rem; line-height: 1; color: var(--brand-gold); }

.program-tile { display: block; height: 100%; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.program-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-navy-2); color: inherit; }
.program-icon { font-size: 1.35rem; line-height: 1; color: var(--brand-gold); }
.district-theme .program-icon { color: var(--dt-main); }

.district-tile { display: block; height: 100%; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border-soft); border-top: 4px solid var(--dt-main); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.district-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.district-tile .bi-geo-alt-fill { color: var(--dt-main); }
.district-tile .progress-bar { background: var(--dt-main); }

.live-dot::before { content: ""; display: inline-block; width: .45em; height: .45em; margin-right: .3em; border-radius: 50%; background: currentColor; vertical-align: middle; animation: live-pulse 1.2s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-dot::before { animation: none; } }

/* ---------- SweetAlert2 ---------- */
.swal2-popup { font-family: var(--bs-body-font-family); border-radius: 16px; }
.swal2-html-container { white-space: pre-line; }
[data-bs-theme="dark"] .swal2-popup { background: var(--surface); color: #e8ecf8; }

@media print {
  .site-header, .site-footer, .front-sidebar, .float-nav, .admin-sidebar, .admin-header, .admin-footer, .dt-buttons, .dt-search, .dt-paging { display: none !important; }
  .admin-main { margin: 0 !important; }
  body { background: #fff; }
}
