/* ระบบผลงานและความภาคภูมิใจ — โรงเรียนบ้านเหล็ก */
:root {
  --blue: #1e5bc6;
  --blue-dark: #0d3d99;
  --blue-deep: #0a2a6b;
  --gold: #f5b301;
  --gold-light: #ffd54f;
  --orange: #f58220;
  --orange-dark: #d9531e;
  --sky: #dff0ff;
  --ink: #16305e;
  --muted: #5c6b8a;
  --line: #d9e4f5;
  --white: #fff;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(13, 61, 153, .14);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Kanit', system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #bfe0ff 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #c8e6ff 0%, transparent 55%),
    linear-gradient(180deg, #eef6ff 0%, #f7fbff 40%, #eaf2ff 100%);
  min-height: 100vh;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.page { max-width: 1400px; margin: 0 auto; padding: 14px 18px 0; }
.container { max-width: 1400px; margin: 0 auto; }

/* ---------- แถบเมนู ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 8px 14px 8px 10px;
  box-shadow: var(--shadow);
  position: sticky; top: 10px; z-index: 50;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand img { width: 52px; height: 52px; }
.brand b { display: block; color: var(--blue); font-size: 20px; font-weight: 700; line-height: 1.1; }
.brand small { color: var(--blue-dark); font-size: 13px; }
.nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 30px;
  color: var(--blue-dark); font-weight: 500; font-size: 15px;
  transition: background .15s;
}
.nav a i { color: var(--blue); font-size: 17px; }
.nav a:hover { background: var(--sky); }
.nav a.active {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--blue-deep); font-weight: 600;
  box-shadow: 0 4px 12px rgba(245,179,1,.45);
}
.nav a.active i { color: var(--blue-deep); }
.nav a.nav-admin {
  margin-left: 6px;
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(30, 91, 198, .38);
}
.nav a.nav-admin i { color: var(--gold-light); }
.nav a.nav-admin:hover { background: linear-gradient(180deg, var(--blue-dark), var(--blue-deep)); }
.nav-toggle { display: none; margin-left: auto; border: 0; background: var(--sky); color: var(--blue); width: 42px; height: 42px; border-radius: 50%; font-size: 18px; }

/* ---------- ฮีโร่ ---------- */
.hero {
  position: relative;
  margin-top: 18px;
  display: grid; grid-template-columns: minmax(280px, 1fr) 1.4fr; gap: 26px;
  align-items: stretch;
  padding: 22px;
  border-radius: 28px; overflow: hidden;
  background: url('../img/background.png') center / cover no-repeat, var(--sky);
  box-shadow: var(--shadow);
}
/* ฟิล์มจาง ๆ มุมขวาบน ให้ตัวหนังสือหัวเรื่องอ่านง่ายขึ้นบนพื้นภาพ */
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom left, rgba(255,255,255,.42) 0%, rgba(255,255,255,.12) 40%, rgba(255,255,255,0) 70%);
}
.hero > * { position: relative; z-index: 1; }
.hero-art {
  position: relative; min-height: 380px; border-radius: 28px; overflow: hidden;
  background: linear-gradient(160deg, #7fc4ff 0%, #2f80e0 60%, #1e5bc6 100%);
  box-shadow: var(--shadow);
}
/* ยังไม่ได้อัปโหลดภาพฮีโร่ → ปล่อยให้เห็นภาพพื้นหลังตรง ๆ */
.hero-art.is-empty { background: none; box-shadow: none; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-main { display: flex; flex-direction: column; gap: 18px; }
.banner { position: relative; text-align: center; padding: 8px 0 4px; }
.banner h1 {
  margin: 0; font-size: clamp(30px, 4.6vw, 58px); font-weight: 800; line-height: 1.05;
  color: var(--gold);
  -webkit-text-stroke: 1.5px var(--orange-dark);
  text-shadow: 0 3px 0 var(--orange-dark), 0 8px 18px rgba(217,83,30,.35);
  letter-spacing: .5px;
}
.banner h1 span { display: block; color: #fff; -webkit-text-stroke: 1.5px var(--blue-dark); text-shadow: 0 3px 0 var(--blue-dark), 0 8px 18px rgba(13,61,153,.35); font-size: .82em; }
.banner .ribbon {
  display: inline-block; margin-top: 12px; padding: 8px 26px;
  background: linear-gradient(180deg, #ffe58a, var(--gold));
  color: var(--blue-deep); font-weight: 600; font-size: clamp(15px, 1.6vw, 20px);
  border-radius: 30px; box-shadow: 0 4px 12px rgba(245,179,1,.4);
}
.badge-corner {
  position: absolute; left: -150px; top: 0;   /* ยื่นออกไปในช่องว่างระหว่างภาพกับหัวเรื่อง */
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff; font-weight: 600; font-size: 14px; text-align: center; line-height: 1.2;
  padding: 12px 14px; border-radius: 18px; transform: rotate(-6deg);
  box-shadow: 0 6px 16px rgba(10,42,107,.35); max-width: 170px;
}
.badge-corner i { display: block; font-size: 30px; color: var(--gold-light); margin-bottom: 4px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
  border: 1px solid #fff;
}
.stat i { font-size: 38px; color: var(--gold); width: 44px; text-align: center; }
.stat i.blue { color: var(--blue); }
.stat b { display: block; font-size: 34px; font-weight: 700; color: var(--blue-dark); line-height: 1; }
.stat span { font-size: 14px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.tile {
  color: #fff; border-radius: var(--radius); padding: 22px 12px 16px; text-align: center;
  font-weight: 600; font-size: 16px; line-height: 1.2; min-height: 130px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,.14); transition: transform .15s;
}
.tile i { font-size: 44px; }
.tile:hover, .tile.active { transform: translateY(-4px); outline: 3px solid var(--gold); }
.tile small { display: block; font-weight: 400; font-size: 12px; opacity: .9; }

/* ---------- แอนิเมชันฮีโร่ ---------- */
/* ตอนเข้า: ใช้ fill-mode backwards เพื่อให้สถานะปลายทางเท่ากับ CSS ปกติ ไม่ไปทับ transform ตอน hover */
@keyframes heroFadeUp    { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes heroSlideIn   { from { opacity: 0; transform: translateX(-40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes heroDrop      { 0% { opacity: 0; transform: translateY(-40px) scale(1.12); } 60% { opacity: 1; transform: translateY(6px) scale(.98); } 100% { opacity: 1; transform: none; } }
@keyframes heroPop       { 0% { opacity: 0; transform: scale(.5); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes badgeIn       { 0% { opacity: 0; transform: rotate(20deg) scale(.4); } 70% { opacity: 1; transform: rotate(-10deg) scale(1.08); } 100% { opacity: 1; transform: rotate(-6deg) scale(1); } }
/* ต่อเนื่อง: ให้หน้าไม่นิ่ง */
@keyframes badgeSwing    { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(-10deg) translateY(-4px); } }
@keyframes kenBurns      { from { transform: scale(1) translateX(0); } to { transform: scale(1.08) translateX(-1.5%); } }
@keyframes shimmer       { 0% { transform: translateX(-160%) skewX(-20deg); } 100% { transform: translateX(260%) skewX(-20deg); } }
@keyframes glowPulse     { 0%, 100% { text-shadow: 0 3px 0 var(--orange-dark), 0 8px 18px rgba(217,83,30,.35); } 50% { text-shadow: 0 3px 0 var(--orange-dark), 0 8px 30px rgba(245,179,1,.85), 0 0 40px rgba(255,229,138,.55); } }
@keyframes floatY        { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes iconBob       { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-6px) rotate(-7deg); } 60% { transform: translateY(0) rotate(6deg); } }
@keyframes sparkle       { 0%, 100% { opacity: 0; transform: translateY(0) scale(.3) rotate(0); } 50% { opacity: 1; transform: translateY(-34px) scale(1) rotate(180deg); } }

.hero-art { animation: heroSlideIn .8s cubic-bezier(.2,.8,.2,1) both; }
.hero-art img { animation: kenBurns 14s ease-in-out infinite alternate; }
.banner h1 { animation: heroDrop .7s .15s cubic-bezier(.2,.8,.2,1) backwards, glowPulse 3s 1.2s ease-in-out infinite; }
.banner h1 span { animation: heroFadeUp .6s .4s cubic-bezier(.2,.8,.2,1) backwards; }
.banner .ribbon { position: relative; overflow: hidden; animation: heroPop .55s .65s cubic-bezier(.2,.8,.2,1) backwards; }
.banner .ribbon::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.75), rgba(255,255,255,0));
  animation: shimmer 2.8s 1.5s ease-in-out infinite;
}
.badge-corner { animation: badgeIn .7s .75s cubic-bezier(.2,.8,.2,1) both, badgeSwing 3.2s 1.45s ease-in-out infinite; }

.stat { transition: transform .2s, box-shadow .2s; animation: heroFadeUp .6s cubic-bezier(.2,.8,.2,1) backwards; }
.stat:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(30,91,198,.22); }
.stat:nth-child(1) { animation-delay: .55s; } .stat:nth-child(2) { animation-delay: .65s; }
.stat:nth-child(3) { animation-delay: .75s; } .stat:nth-child(4) { animation-delay: .85s; }
.stat i { animation: floatY 3s ease-in-out infinite; }
.stat:nth-child(2) i { animation-delay: .4s; } .stat:nth-child(3) i { animation-delay: .8s; } .stat:nth-child(4) i { animation-delay: 1.2s; }

.tile { animation: heroFadeUp .6s cubic-bezier(.2,.8,.2,1) backwards; transition: transform .15s, box-shadow .15s; }
.tile:hover { box-shadow: 0 14px 26px rgba(0,0,0,.22); }
.tile:nth-child(1) { animation-delay: .9s; }  .tile:nth-child(2) { animation-delay: .98s; }
.tile:nth-child(3) { animation-delay: 1.06s; } .tile:nth-child(4) { animation-delay: 1.14s; }
.tile:nth-child(5) { animation-delay: 1.22s; } .tile:nth-child(6) { animation-delay: 1.3s; }
.tile i { animation: iconBob 4s ease-in-out infinite; }
.tile:nth-child(2) i { animation-delay: .5s; } .tile:nth-child(3) i { animation-delay: 1s; }
.tile:nth-child(4) i { animation-delay: 1.5s; } .tile:nth-child(5) i { animation-delay: 2s; } .tile:nth-child(6) i { animation-delay: 2.5s; }

/* ฟองอากาศลอยขึ้นช้า ๆ แกว่งซ้าย-ขวาสลับกัน (สร้างด้วย main.js; --rise = ความสูงฮีโร่, --sway = ระยะแกว่ง) */
@keyframes bubbleRise {
  0%   { transform: translate(0, 0) scale(.6); opacity: 0; }
  8%   { opacity: 1; }
  25%  { transform: translate(var(--sway), calc(var(--rise) * -.25)) scale(.8); }
  50%  { transform: translate(calc(var(--sway) * -1), calc(var(--rise) * -.5)) scale(1); }
  75%  { transform: translate(var(--sway), calc(var(--rise) * -.75)) scale(1.05); }
  92%  { opacity: .6; }
  100% { transform: translate(0, calc(var(--rise) * -1)) scale(1.15); opacity: 0; }
}
.hero .bubble {
  position: absolute; z-index: 2; pointer-events: none; bottom: -60px;
  width: var(--size, 24px); height: var(--size, 24px); border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,1) 0%, rgba(255,255,255,.6) 24%, rgba(255,255,255,.22) 60%, rgba(255,255,255,.1) 100%);
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: inset -4px -4px 8px rgba(255,255,255,.7), inset 3px 3px 6px rgba(120,190,255,.35), 0 0 12px rgba(255,255,255,.7), 0 3px 10px rgba(30,91,198,.25);
  animation: bubbleRise var(--dur, 16s) var(--delay, 0s) ease-in-out infinite;
}

/* ประกายดาวลอยในฮีโร่ (สร้างด้วย main.js) */
.hero .spark {
  position: absolute; z-index: 2; pointer-events: none; color: var(--gold-light);
  text-shadow: 0 0 8px rgba(255,229,138,.9), 0 0 16px rgba(245,179,1,.6);
  animation: sparkle var(--dur, 4s) var(--delay, 0s) ease-in-out infinite;
}

/* ---------- ส่วนรางวัล ---------- */
.section { margin-top: 26px; background: #fff; border-radius: 28px; padding: 22px 24px 26px; box-shadow: var(--shadow); }
.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title {
  display: inline-flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue));
  color: var(--gold-light); font-size: clamp(20px, 2.6vw, 30px); font-weight: 700;
  padding: 8px 28px 8px 18px; border-radius: 12px 40px 40px 12px; box-shadow: 0 6px 14px rgba(13,61,153,.3);
}
.section-title i { color: var(--gold); font-size: 1.1em; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 30px;
  font-family: inherit; font-weight: 600; font-size: 15px; border: 0; cursor: pointer; transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(30,91,198,.35); }
.btn-gold { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--blue-deep); }
.btn-outline { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
.btn-red { background: #e0453a; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.ml-auto { margin-left: auto; }

.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 14px rgba(13,61,153,.08); display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-img {
  width: 250px; max-width: 100%; height: 290px; margin: 0 auto;
  background: #eef4fc; overflow: hidden; position: relative;
}
/* contain = ย่อให้เห็นภาพครบทั้งใบ ไม่ถูกครอบตัด (ขอบที่เหลือเป็นพื้นฟ้าอ่อนของ .card-img) */
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.card-img .cat-tag { position: absolute; left: 10px; top: 10px; color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.card-body { padding: 12px 12px 14px; text-align: center; flex: 1; }
.card-body b { display: block; color: var(--blue-dark); font-size: 18px; font-weight: 700; line-height: 1.2; }
.card-body p { margin: 6px 0 0; font-size: 14px; color: var(--ink); }
.card-body small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.level-pill { display: inline-block; background: var(--sky); color: var(--blue-dark); font-size: 12px; padding: 2px 10px; border-radius: 20px; margin-top: 6px; }

/* ---------- ปฏิทินเลือกวันที่ พ.ศ. ---------- */
.date-be-picker { position: relative; }
.date-be-display { cursor: pointer; background: #fff; }
.cal {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 300px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 12px;
}
.cal-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.cal-head select {
  flex: 1 1 0; min-width: 0; font-family: inherit; font-size: 14px; padding: 6px 8px;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.cal-nav { border: 0; background: var(--sky); color: var(--blue); width: 30px; height: 30px; border-radius: 8px; font-size: 16px; cursor: pointer; flex: none; }
.cal-nav:hover { background: var(--gold-light); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-dow { font-size: 12px; color: var(--muted); padding: 4px 0; font-weight: 500; }
.cal-day { border: 0; background: none; font-family: inherit; font-size: 14px; color: var(--ink); padding: 6px 0; border-radius: 8px; cursor: pointer; }
.cal-day:hover { background: var(--sky); }
.cal-day.now { outline: 1.5px solid var(--gold); }
.cal-day.sel { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--blue-deep); font-weight: 600; }
.cal-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.cal-foot button { border: 0; background: none; font-family: inherit; font-size: 13px; color: var(--blue); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.cal-foot button:hover { background: var(--sky); }

/* ---------- เครื่องมือเลือกกรอบแสดงภาพ (หลังบ้าน) ---------- */
[hidden] { display: none !important; }
.crop-wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; margin-top: 10px; }
.crop-stage { position: relative; user-select: none; touch-action: none; border-radius: 10px; overflow: hidden; background: #eef4fc; }
.crop-stage img { display: block; max-width: 100%; max-height: 340px; }
.crop-stage.off .crop-box { display: none; }
.crop-stage.off img { opacity: .6; }
.crop-box { position: absolute; box-sizing: border-box; cursor: move; border: 2px solid var(--gold); box-shadow: 0 0 0 9999px rgba(10,42,107,.45); }
.crop-handle { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; cursor: nwse-resize; }
.crop-side { display: flex; flex-direction: column; gap: 8px; }
.crop-preview { position: relative; width: 125px; height: 145px; overflow: hidden; border-radius: 10px; background: #eef4fc; border: 1px solid var(--line); }
.crop-preview.off img { position: static; width: 100%; height: 100%; object-fit: contain; }
.crop-hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- ตัวกรอง / ค้นหา ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters input, .filters select, .form-control {
  font-family: inherit; font-size: 15px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.filters input:focus, .filters select:focus, .form-control:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.filters input { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 6px 14px; border-radius: 30px; background: var(--sky); color: var(--blue-dark); font-size: 14px; font-weight: 500; border: 2px solid transparent; }
.chip.active { border-color: currentColor; color: #fff; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty i { font-size: 50px; color: var(--line); display: block; margin-bottom: 10px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 10px; background: var(--sky); color: var(--blue-dark); font-weight: 500; }
.pagination .cur { background: var(--blue); color: #fff; }

/* ---------- หน้ารายละเอียด ---------- */
.detail { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; }
.detail-img { border-radius: var(--radius); overflow: hidden; background: #eef4fc; box-shadow: var(--shadow); }
.detail h1 { margin: 0 0 6px; color: var(--blue-dark); font-size: clamp(24px, 3vw, 36px); line-height: 1.15; }
.detail h2 { margin: 0 0 14px; font-weight: 500; font-size: 20px; color: var(--ink); }
.detail dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; margin: 18px 0; font-size: 15px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; font-weight: 500; }
.detail .desc { white-space: pre-line; background: #f5f9ff; padding: 16px; border-radius: 12px; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--blue); }

/* ---------- หน้าทั่วไป ---------- */
.prose { max-width: 820px; font-size: 16px; }
.prose p { white-space: pre-line; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.contact-grid .stat i { font-size: 30px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery a { border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: #eef4fc; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.05); }

/* ---------- ท้ายเว็บ ---------- */
.footer { margin-top: 30px; position: relative; }
.footer-wave { height: 26px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.footer-inner {
  background: linear-gradient(180deg, var(--blue), var(--blue-deep)); color: #fff;
  padding: 24px 28px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 15px;
}
.footer-copy { background: var(--blue-deep); color: #b8cdf5; text-align: center; padding: 10px; font-size: 13px; border-radius: 0 0 22px 22px; }

/* ---------- ระบบหลังบ้าน ---------- */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 28px); gap: 18px; }
.sidebar { background: linear-gradient(180deg, var(--blue-dark), var(--blue-deep)); border-radius: 22px; padding: 18px 12px; color: #fff; position: sticky; top: 14px; height: fit-content; }
.sidebar .brand { padding: 6px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 12px; }
.sidebar .brand b, .sidebar .brand small { color: #fff; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; font-weight: 500; }
.sidebar a i { width: 20px; text-align: center; color: var(--gold-light); }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,.14); }
.admin-main { min-width: 0; }
.admin-main .section { margin-top: 0; }
.admin-main .section + .section { margin-top: 18px; }
.page-title { margin: 0 0 16px; font-size: 26px; color: var(--blue-dark); display: flex; align-items: center; gap: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: var(--sky); color: var(--blue-dark); font-weight: 600; }
.table img.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.table-wrap { overflow-x: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 14px; color: var(--blue-dark); }
.field .form-control { width: 100%; }
.field textarea.form-control { min-height: 100px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: #e4f8ea; color: #197a3a; }
.alert-danger { background: #fde8e6; color: #b3261e; }
.alert-warning { background: #fff4d6; color: #8a5a00; }
.login-box { max-width: 420px; margin: 8vh auto; }
.login-box .section { text-align: center; }
.login-box img { width: 90px; margin: 0 auto 10px; }
.login-box .field { text-align: left; margin-bottom: 14px; }
.dash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.color-dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 240px; }
  .badge-corner { left: 0; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; border-radius: 24px; }
  .nav-toggle { display: grid; place-items: center; }
  .nav { display: none; width: 100%; flex-direction: column; margin: 8px 0 4px; }
  .nav.open { display: flex; }
  .detail { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dash { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .page { padding: 10px 10px 0; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat b { font-size: 26px; }
  .section { padding: 16px 14px 20px; border-radius: 20px; }
  .badge-corner { display: none; }
  .detail dl { grid-template-columns: 1fr; gap: 2px 0; }
  .detail dt { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .hero .spark, .hero .bubble { display: none; } }
