/* ================= ระบบหลังบ้าน (โทนเดียวกับเว็บ) ================= */
.admin-body { display: flex; min-height: 100vh; background: #eef6fd; }

.side {
  width: 248px; flex: 0 0 248px; background: linear-gradient(180deg, #0b3560, #0a4b91);
  color: #cfe6fa; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px; color: #fff; font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.side-brand small { display: block; font-size: 10px; letter-spacing: 2px; color: #7fb8e8; font-weight: 500; }
.side-menu { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-menu a {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 10px;
  color: #bcd9f3; font-size: 14.5px; font-weight: 500; transition: background .15s, color .15s;
}
.side-menu a em { font-style: normal; width: 20px; text-align: center; }
.side-menu a:hover { background: rgba(255,255,255,.09); color: #fff; }
.side-menu a.on { background: linear-gradient(135deg, #1673e0, #37a6f0); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.badge-n {
  font-style: normal; margin-left: auto; background: #ff7043; color: #fff; font-size: 11.5px; font-weight: 700;
  min-width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px;
}
.side-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 8px; }
.side-foot a { color: #9fc9ea; font-size: 13px; }
.side-foot a:hover { color: #fff; }

.main { flex: 1; padding: 26px 30px 60px; min-width: 0; }
.main-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.main-head h1 { font-size: 24px; margin: 0 0 2px; }

/* สถิติหน้า dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
  box-shadow: var(--shadow); display: flex; gap: 16px; align-items: center;
}
.stat .ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg, #e2f1fe, #c9e5fb); color: var(--primary); }
.stat b { font-size: 24px; font-family: var(--mono); color: var(--deep); display: block; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }

/* ตารางข้อมูล */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: auto; box-shadow: var(--shadow); }
table.adm { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 700px; }
.adm th, .adm td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #e4f0fb; vertical-align: middle; }
.adm th { background: #f4faff; color: var(--deep); font-size: 13px; white-space: nowrap; }
.adm tr:last-child td { border-bottom: 0; }
.adm tr:hover td { background: #f8fcff; }
.adm .actions { white-space: nowrap; display: flex; gap: 6px; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.ok { background: #e2f7ec; color: #0d6640; }
.pill.wait { background: #fdf1dc; color: #8a5a08; }
.pill.new { background: #e3f0fd; color: #175c9e; }
.pill.off { background: #eee; color: #777; }
.thumb { width: 86px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ฟอร์มหลังบ้าน */
.adm-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 26px; margin-bottom: 24px; }
.adm-card h2 { font-size: 17px; border-bottom: 1px dashed var(--line); padding-bottom: 12px; margin: 0 0 18px; color: var(--deep); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
textarea.code { font-family: var(--mono); font-size: 13px; }
.img-preview { max-width: 260px; border-radius: 12px; border: 1px solid var(--line); margin-top: 10px; }
.form-foot { display: flex; gap: 10px; margin-top: 22px; }
.inline-form { display: inline; }
.btn-danger { background: #fdeeee; color: #b23333; border: 1.5px solid #f2c1c1; }
.btn-danger:hover { background: #e05252; color: #fff; border-color: #e05252; }
.btn { font-size: 14px; padding: 9px 18px; }
.table-actions-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* login */
.login-body { display: grid; place-items: center; background: radial-gradient(900px 480px at 80% -10%, #bfdff8, transparent), linear-gradient(160deg, #e8f5ff, #cfe6fa); padding: 20px; }
.login-card { width: min(402px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 36px 34px; text-align: center; }
.login-card h1 { font-size: 21px; margin: 14px 0 2px; }
.login-card .inp { text-align: left; }
.login-card label.f-label { display: block; text-align: left; margin-top: 14px; }
.login-logo { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 18px; background: linear-gradient(135deg, #e2f1fe, #c9e5fb); }

@media (max-width: 940px) {
  .admin-body { flex-direction: column; }
  .side { width: auto; height: auto; position: static; }
  .side-menu { flex-direction: row; flex-wrap: wrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
