/* ============================================================
   โครงการครูรัก(ษ์)ถิ่น - ธีมชมพู-เทา (Pink & Charcoal Grey Theme)
   ปราศจากสีส้ม 100% (No Orange)
   Colors: Academic Rose Pink (#db2777 / #be185d), Charcoal Grey (#18181b / #27272a), Soft Grey (#f1f5f9)
   ============================================================ */

:root {
  /* โทนสีชมพู - เทา (Pink & Grey Palette) */
  --primary-pink: #db2777;       /* ชมพูวิชาการสดใส */
  --primary-pink-dark: #be185d;  /* ชมพูเข้ม */
  --primary-pink-deep: #9d174d;  /* ชมพูเข้มลึก */
  --primary-pink-light: #fce7f3; /* ชมพูอ่อน */
  
  --charcoal-900: #18181b;       /* เทาเข้มจัด (แทนสีน้ำเงิน/ส้ม) */
  --charcoal-800: #27272a;       /* เทาเข้ม */
  --charcoal-700: #3f3f46;
  --charcoal-100: #f4f4f5;

  --bg-main: #f8fafc;            /* เทาอ่อนสะอาดตา */
  --bg-card: #ffffff;            /* การ์ดสีขาวบริสุทธิ์ */
  --bg-muted: #f1f5f9;

  --text-primary: #18181b;       /* ตัวอักษรสีดำเทาเข้ม คมชัด อ่านง่ายมาก */
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-light: #e2e8f0;
  --border-pink: #fbcfe8;

  --shadow-sm: 0 1px 3px rgba(24, 24, 27, 0.05);
  --shadow-md: 0 4px 14px -2px rgba(24, 24, 27, 0.08);
  --shadow-lg: 0 15px 30px -5px rgba(24, 24, 27, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 1.02rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* หัวข้อสไตล์วิชาการ คมชัด สบายตา */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 600;
  color: var(--charcoal-900);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

a {
  color: var(--primary-pink-dark);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-pink);
}

/* --------------------------------------------------------
   1. Header & Navbar (ธีมชมพู-เทาเข้ม)
   -------------------------------------------------------- */
.top-nav {
  background: var(--charcoal-900);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--primary-pink);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* โลโก้ภาพ ครูรัก(ษ์)ถิ่น บนส่วนหัว */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.logo-img:hover {
  transform: scale(1.03);
}

/* เมนูหลักบรรทัดเดียว ไม่ตัดคำ */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: nowrap;
}

.nav-link {
  padding: 0.55rem 0.9rem;
  color: #e4e4e7;
  font-size: 0.94rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-link.active {
  color: #ffffff;
  background: var(--primary-pink);
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.4);
}

.qa-public-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.35rem 1rem; margin-bottom:.55rem; color:var(--text-muted); font-size:.82rem; }
.qa-public-meta i { color:var(--primary-pink); }
.qa-public-title { margin:0 0 .5rem; color:var(--charcoal-900); font-size:1.12rem; }
.qa-public-content { margin:0 0 .85rem; color:var(--text-secondary); font-size:.95rem; white-space:pre-line; }
.qa-public-answer { padding:1rem 1.2rem; color:var(--primary-pink-dark); background:#fdf2f8; border:1px solid var(--border-pink); border-radius:var(--radius-md); font-size:.92rem; }
.qa-public-answer > :first-child { margin-bottom:.25rem; font-weight:700; }
.qa-public-pending { color:var(--text-muted); font-size:.85rem; font-style:italic; }
.qa-empty { padding:1.25rem; color:var(--text-muted); text-align:center; background:#f8fafc; border:1px dashed #cbd5e1; border-radius:12px; }

.btn-login {
  background: linear-gradient(135deg, var(--primary-pink), var(--primary-pink-dark));
  color: #ffffff;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-full);
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(219, 39, 119, 0.35);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(219, 39, 119, 0.5);
}

/* --------------------------------------------------------
   2. Main Wrapper
   -------------------------------------------------------- */
.main-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------
   3. Hero Banner (ธีมชมพูวิชาการ & เทาเข้ม)
   -------------------------------------------------------- */
.hero-banner {
  background: linear-gradient(135deg, var(--charcoal-900) 0%, var(--charcoal-800) 65%, #831843 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 3rem 2.2rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  border-left: 6px solid var(--primary-pink);
  box-shadow: var(--shadow-lg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2.5rem;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(219, 39, 119, 0.25);
  color: #fce7f3;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  margin-bottom: 1.1rem;
  border: 1px solid rgba(219, 39, 119, 0.4);
}

.hero-title {
  font-size: 2.25rem;
  color: #ffffff;
  margin-bottom: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.hero-desc {
  color: #f4f4f5;
  font-size: 1.05rem;
  margin-bottom: 1.8rem;
  line-height: 1.8;
  max-width: 680px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-item { text-align: center; }

.stat-val {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
  color: #f472b6;
}

.stat-lbl {
  font-size: 0.82rem;
  color: #e4e4e7;
}

/* --------------------------------------------------------
   4. News & Video Sections (แยกเป็นคนละส่วนชัดเจน)
   -------------------------------------------------------- */
.section-title {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 5px solid var(--primary-pink);
  padding-left: 1rem;
}

.section-title h2 {
  font-size: 1.55rem;
  color: var(--charcoal-900);
}

.news-grid, .video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .news-grid, .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .news-grid, .video-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------
   Hero News Banner Slider (สไลด์แบนเนอร์ข่าวเด่นหน้าแรก)
   -------------------------------------------------------- */
.banner-slider-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  background: var(--charcoal-900);
}

.banner-slide {
  position: relative;
  width: 100%;
  height: 520px;
  display: none;
}

.banner-slide.active {
  display: block;
  animation: fadeInSlide 0.5s ease-in-out;
}

@keyframes fadeInSlide {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.banner-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}

.banner-slide-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0; top: 0;
  background: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  color: #ffffff;
}

.banner-text-box {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  align-self: flex-start;
  max-width: 460px;
}

.banner-badge {
  background: var(--primary-pink);
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.3rem;
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(219,39,119,0.3);
}

.banner-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.banner-desc {
  font-size: 0.95rem;
  color: #f4f4f5;
  margin-bottom: 1rem;
  max-width: 800px;
  line-height: 1.6;
}

.banner-slider-controls {
  position: absolute;
  bottom: 1.2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 10;
}

.btn-banner-ctrl {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.4);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.btn-banner-ctrl:hover {
  background: var(--primary-pink);
  border-color: var(--primary-pink);
}

.banner-dots {
  display: flex;
  gap: 0.4rem;
}

.banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.banner-dot.active {
  background: var(--primary-pink);
  width: 24px;
  border-radius: 12px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-pink);
}

.card-media {
  position: relative;
  width: 100%;
  height: 210px;
  background: var(--charcoal-900);
}

.card-media img, .card-media iframe, .card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

/* --------------------------------------------------------
   Pagination Controls (ระบบแบ่งหน้าวิดีโอ 3 กิจกรรม/หน้า)
   -------------------------------------------------------- */
.video-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.8rem;
  margin-bottom: 2.5rem;
}

.btn-page-ctrl {
  background: #ffffff;
  color: var(--charcoal-900);
  border: 1px solid var(--border-light);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  font-family: 'Prompt', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
}

.btn-page-ctrl:hover:not(:disabled) {
  background: var(--primary-pink);
  color: #ffffff;
  border-color: var(--primary-pink);
}

.btn-page-ctrl:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-page-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--charcoal-900);
  border: 1px solid var(--border-light);
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-page-num:hover, .btn-page-num.active {
  background: var(--primary-pink);
  color: #ffffff;
  border-color: var(--primary-pink);
}

.video-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary-pink);
  color: #ffffff;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.card-body {
  padding: 1.4rem;
}

.card-cat {
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Prompt', sans-serif;
  color: var(--primary-pink-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.card-h {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--charcoal-900);
  margin-bottom: 0.6rem;
  line-height: 1.45;
}

.card-p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.65;
}

/* --------------------------------------------------------
   5. Pop-up Modal เข้าสู่ระบบ
   -------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  box-sizing: border-box;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(24, 24, 27, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

body:has(.modal-overlay.active) { overflow: hidden; }

.modal-card {
  box-sizing: border-box;
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  overflow-y: auto;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--primary-pink);
  position: relative;
  transform: translateY(12px);
  transition: transform 0.25s ease-out;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-card .modal-header h3 { font-size: clamp(1.25rem, 2vw, 1.5rem) !important; line-height: 1.4; }
.modal-card .modal-header p { font-size: 1rem !important; line-height: 1.55; }
.modal-card .form-group label { display: block; margin-bottom: .4rem; font-size: 1rem; }
.modal-card .form-control { box-sizing: border-box; width: 100%; min-height: 44px; font-size: 1rem; }
.modal-card button { min-height: 44px; font-size: 1rem; }

.action-confirm-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(460px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  overflow-y: auto;
  border: 1px solid #fbcfe8;
  border-radius: 18px;
  background: #fff;
  color: #172b49;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
  font-family: 'Sarabun', sans-serif;
}
.action-confirm-dialog::backdrop { background: rgba(15, 23, 42, .62); backdrop-filter: blur(3px); }
.action-confirm-dialog h2 { margin: 0 0 .65rem; font: 700 1.35rem/1.4 'Prompt', sans-serif; }
.action-confirm-dialog p { margin: 0; font-size: 1.05rem; line-height: 1.65; }
.action-confirm-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; }
.action-confirm-actions button { min-width: 110px; min-height: 46px; padding: .65rem 1rem; border-radius: 999px; font: 600 1rem/1.35 'Prompt', sans-serif; cursor: pointer; }
.action-confirm-cancel { border: 1px solid #cbd5e1; background: #fff; color: #334155; }
.action-confirm-submit { border: 1px solid #be123c; background: #be123c; color: #fff; }
.action-confirm-submit:hover { background: #9f1239; }
@media (max-width: 600px) {
  .modal-overlay { padding: .5rem; }
  .modal-card { max-height: calc(100dvh - 1rem); padding: 1.2rem; }
  .action-confirm-actions button { flex: 1; }
}

/* --------------------------------------------------------
   6. E-Portfolio & Profile Styles
   -------------------------------------------------------- */
.portfolio-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.8rem;
}

.sidebar-profile {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--primary-pink);
  box-shadow: var(--shadow-sm);
  text-align: center;
  height: fit-content;
}

.profile-avatar-lg {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid var(--primary-pink);
  margin: 0 auto 1.2rem;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.3);
}

.profile-name {
  font-size: 1.35rem;
  color: var(--charcoal-900);
  margin-bottom: 0.3rem;
}

.profile-role {
  font-size: 0.88rem;
  color: var(--primary-pink-dark);
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  margin-bottom: 1.2rem;
  background: #fdf2f8;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  display: inline-block;
  border: 1px solid var(--border-pink);
}

.profile-meta-list {
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--border-light);
  padding-top: 1.2rem;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.profile-meta-item i {
  color: var(--primary-pink);
  width: 20px;
  text-align: center;
}

.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.8rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0.85rem;
}

.btn-add {
  background: #fdf2f8;
  color: var(--primary-pink-dark);
  border: 1px solid var(--border-pink);
  padding: 0.45rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add:hover {
  background: var(--primary-pink);
  color: #ffffff;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.2rem;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary-pink);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--primary-pink-dark);
  font-weight: 600;
  font-family: 'Prompt', sans-serif;
}

.timeline-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--charcoal-900);
}

.timeline-org {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------
   7. Form Controls & Buttons
   -------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Prompt', sans-serif;
  color: var(--charcoal-900);
}

.form-control {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-family: 'Sarabun', sans-serif;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--primary-pink);
  box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.15);
}

.qa-author-display {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  background: #f7f8fc;
  font-weight: 600;
}

/* --------------------------------------------------------
   8. Admin Dashboard Layout & Components (Full Width เต็มจอ)
   -------------------------------------------------------- */
.admin-container {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  flex: 1;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  background: var(--bg-card);
  border-radius: 0;
  border: none;
  min-height: calc(100vh - 60px);
  width: 100%;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #ffffff;
}

.admin-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border-light);
  padding: 1.2rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.admin-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 80px);
  padding: 1.5rem 2rem;
  background: #f8fafc;
  width: 100%;
  box-sizing: border-box;
}

.admin-footer {
  margin-top: 3.5rem;
  padding: 1.8rem 0 1rem 0;
  border-top: 1px solid #cbd5e1;
  text-align: center;
  color: #475569;
  font-size: 0.88rem;
  font-family: 'Prompt', sans-serif;
  line-height: 1.6;
  width: 100%;
}

.admin-brand {
  font-family: 'Prompt', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #a855f7;
  margin-bottom: 2rem;
  padding-left: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-nav-item {
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: 'Prompt', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--charcoal-900); /* ดำเทาเข้ม คมชัด อ่านง่ายมาก */
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.admin-nav-item:hover, .admin-nav-item.active {
  background: #fdf2f8;
  color: var(--primary-pink-dark);
  font-weight: 700;
  border-left: 4px solid var(--primary-pink);
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.15);
}

.admin-nav-item i {
  width: 20px;
  text-align: center;
}

.admin-content {
  padding: 2rem;
  background: #fafafa;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}

.admin-year-badge {
  font-family: 'Prompt', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--charcoal-900);
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card-completion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.completion-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.4rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.completion-card.pink {
  background: #fce7f3;
  border-color: #fbcfe8;
}

.completion-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--charcoal-900);
  margin-bottom: 0.6rem;
}

.completion-percent {
  font-size: 2.3rem;
  font-weight: 800;
  font-family: 'Prompt', sans-serif;
  color: #9333ea;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.completion-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gender-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.4rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.gender-row {
  display: grid;
  grid-template-columns: 80px 70px 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.gender-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal-900);
}

.gender-val {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
  color: var(--charcoal-900);
}

.progress-bar-bg {
  height: 12px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.progress-bar-fill.purple { background: #a855f7; }
.progress-bar-fill.pink { background: #ec4899; }

/* --------------------------------------------------------
   9. User Management Table & Action Buttons
   -------------------------------------------------------- */
.user-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.user-tab-btn {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-bottom: none;
}

.user-tab-btn.active {
  background: #ffffff;
  color: #9333ea;
  font-weight: 600;
}

.user-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  background: #ffffff;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.user-search-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 500px;
}

.btn-search {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--charcoal-900);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: 'Prompt', sans-serif;
  cursor: pointer;
}

.btn-search:hover { background: #f8fafc; }

.btn-export-green {
  background: #059669;
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-export-green:hover { background: #047857; }

.btn-create-purple {
  background: #9333ea;
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-sm);
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-create-purple:hover { background: #7e22ce; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  font-size: 0.86rem;
}

.admin-table th {
  background: #f8fafc;
  color: var(--charcoal-900);
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.65rem 0.5rem;
  text-align: left;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.65rem 0.5rem;
  font-size: 0.86rem;
  color: var(--text-primary);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  word-break: break-word;
}

.admin-table tr:hover { background: #fdf4ff; }

.action-btn-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-act {
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-act.view { color: #0284c7; border-color: #bae6fd; background: #f0f9ff; }
.btn-act.edit { color: #9333ea; border-color: #e9d5ff; background: #f3e8ff; }
.btn-act.delete { color: #e11d48; border-color: #fecdd3; background: #fff1f2; }
.btn-act.pdf { color: #059669; border-color: #a7f3d0; background: #ecfdf5; }

@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portfolio-layout { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .nav-container { flex-wrap: wrap; gap: .7rem 1rem; }
  .nav-menu { display: flex; flex: 1 1 100%; justify-content: center; flex-wrap: wrap; gap: .2rem; order: 3; }
  .nav-link { padding: .45rem .6rem; font-size: .82rem; }
}
