/* ============================================================
   RDFL Style Sheet
   Colors: #1a3a8f (Blue) | #f5c518 (Yellow)
   Font: Sarabun (Thai + Latin)
   ============================================================ */

:root {
  --blue:        #1a3a8f;
  --blue-dark:   #0f2460;
  --blue-light:  #2d5bc4;
  --purple:      #3a1d8a;
  --yellow:      #f5c518;
  --yellow-dark: #d4a80e;
  --text:        #1a1a2e;
  --muted:       #6b7280;
  --bg:          #f4f7fc;
  --white:       #ffffff;
  --shadow:      0 4px 24px rgba(26,58,143,.12);
  --shadow-lg:   0 12px 40px rgba(26,58,143,.22);
  --radius:      14px;
  --radius-sm:   8px;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

a { color: var(--blue); }
img { max-width: 100%; display: block; }

/* ── TH/EN lang toggle (CSS-side) ────────────────────────── */
html[lang="en"] .lang-th { display: none !important; }
html[lang="en"] .lang-en { display: inline !important; }
html[lang="th"] .lang-en { display: none !important; }
html[lang="th"] .lang-th { display: inline !important; }
.lang-en { display: none; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: var(--blue);
  height: 68px;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.navbar-brand img { height: 48px; }
.navbar-brand .brand-text { color: #fff; line-height: 1.3; }
.navbar-brand .brand-text .main  { font-size: .95rem; font-weight: 700; }
.navbar-brand .brand-text .sub   { font-size: .72rem; opacity: .78; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.navbar-nav a {
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  transition: background .18s, color .18s;
}
.navbar-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.navbar-nav a.active { background: var(--yellow); color: var(--blue); font-weight: 700; }

.lang-btn {
  background: transparent;
  border: 1.5px solid rgba(245,197,24,.7);
  color: var(--yellow);
  padding: .3rem .85rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
  margin-left: .5rem;
}
.lang-btn:hover { background: var(--yellow); color: var(--blue); }

.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: all .2s; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg,
    #1a3a8f 0%,
    #2a2090 25%,
    #3a1d8a 50%,
    #6b2fa0 72%,
    #c8920a 88%,
    #f5c518 100%);
  padding: 5.5rem 1.5rem 5rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 20% 50%, rgba(255,255,255,.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 70%, rgba(245,197,24,.1) 0%, transparent 55%);
  pointer-events: none;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  opacity: .08;
  pointer-events: none;
}
.hero-orb-1 { width: 400px; height: 400px; background: #fff; top: -120px; left: -100px; }
.hero-orb-2 { width: 300px; height: 300px; background: var(--yellow); bottom: -80px; right: -60px; }

.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-logo {
  width: 110px; height: 110px;
  object-fit: contain;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 6px 24px rgba(0,0,0,.35));
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: .4rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.hero h2 { font-size: 1.1rem; font-weight: 400; opacity: .9; margin-bottom: 1.25rem; }
.hero-chips { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; }
.hero-chip {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
  padding: .35rem 1.1rem;
  border-radius: 20px;
  font-size: .8rem;
}

/* ── Section Wrapper ──────────────────────────────────────── */
.section-wrap { padding: 4.5rem 1.5rem; }
.section-wrap.alt { background: var(--white); }
.container { max-width: 1200px; margin: 0 auto; }

.sec-header { text-align: center; margin-bottom: 2.75rem; }
.sec-header h2 {
  font-size: 1.7rem; font-weight: 800; color: var(--blue); margin-bottom: .35rem;
}
.sec-header p { color: var(--muted); font-size: .95rem; }
.sec-line {
  width: 56px; height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--yellow));
  border-radius: 2px;
  margin: .65rem auto 0;
}

/* ── Department Cards ─────────────────────────────────────── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.dept-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .28s, box-shadow .28s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.dept-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); }

.dept-card-hd {
  padding: 1.75rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  color: #fff;
}
.dept-card-hd.mep      { background: linear-gradient(135deg,#1a3a8f,#2d5bc4); }
.dept-card-hd.chinese  { background: linear-gradient(135deg,#b71c1c,#e53935); }
.dept-card-hd.japanese { background: linear-gradient(135deg,#880e4f,#e91e63); }

.dept-icon { font-size: 2.4rem; line-height: 1; flex-shrink: 0; }
.dept-card-hd h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .15rem; }
.dept-card-hd p  { font-size: .8rem; opacity: .85; }

.dept-card-bd { padding: 1.25rem 1.5rem; }
.dept-card-bd p { color: var(--muted); font-size: .9rem; line-height: 1.7; }
.dept-card-bd .more {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-top: .85rem; font-size: .85rem; font-weight: 700; color: var(--blue);
}

/* ── System Cards ─────────────────────────────────────────── */
.sys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.sys-card {
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  color: #fff;
  text-decoration: none;
  display: flex; align-items: center; gap: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform .28s, box-shadow .28s;
}
.sys-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.sys-card.learn { background: linear-gradient(135deg,#1a3a8f,#4a1fa8); }
.sys-card.grade { background: linear-gradient(135deg,#006064,#00838f); }

.sys-card-icon { font-size: 2.8rem; flex-shrink: 0; }
.sys-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: .2rem; }
.sys-card p  { font-size: .85rem; opacity: .85; }
.sys-card .arrow { margin-left: auto; font-size: 1.5rem; opacity: .6; }

/* ── News Cards ───────────────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.news-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .28s, box-shadow .28s;
  display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.news-card-img { width: 100%; height: 190px; object-fit: cover; }
.news-card-no-img {
  width: 100%; height: 190px;
  background: linear-gradient(135deg,var(--blue),var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; color: rgba(255,255,255,.5);
}
.news-card-bd { padding: 1.25rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.news-meta { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); margin-bottom: .6rem; }
.news-card-bd h3 {
  font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.news-card-bd .read-more {
  margin-top: .85rem; font-size: .82rem; font-weight: 700;
  color: var(--blue); display: flex; align-items: center; gap: .3rem;
}

/* ── Page Hero (inner pages) ──────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg,var(--blue),var(--blue-light));
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: #fff;
}
.page-hero h1 { font-size: 1.9rem; font-weight: 800; margin-bottom: .4rem; }
.page-hero p  { opacity: .85; font-size: .95rem; }
.breadcrumb { font-size: .8rem; opacity: .7; margin-top: .5rem; }
.breadcrumb a { color: var(--yellow); text-decoration: none; }

/* ── Staff ────────────────────────────────────────────────── */
.dept-tabs {
  display: flex; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 2rem;
}
.dept-tab {
  padding: .45rem 1.25rem;
  border-radius: 20px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  transition: all .18s;
  font-family: inherit;
}
.dept-tab.general  { border-color: var(--blue); color: var(--blue); }
.dept-tab.mep      { border-color: var(--blue); color: var(--blue); }
.dept-tab.chinese  { border-color: #e53935; color: #e53935; }
.dept-tab.japanese { border-color: #e91e63; color: #c2185b; }
.dept-tab.active, .dept-tab:hover { color: #fff; }
.dept-tab.general.active,  .dept-tab.general:hover  { background: var(--blue);   border-color: var(--blue); }
.dept-tab.mep.active,      .dept-tab.mep:hover      { background: var(--blue);   border-color: var(--blue); }
.dept-tab.chinese.active,  .dept-tab.chinese:hover  { background: #e53935;       border-color: #e53935; }
.dept-tab.japanese.active, .dept-tab.japanese:hover { background: #e91e63;       border-color: #e91e63; }

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem;
}
.staff-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: center;
}
.staff-card img { width: 100%; height: 200px; object-fit: cover; object-position: 50% 15%; }
.staff-no-photo {
  width: 100%; height: 200px;
  background: linear-gradient(135deg,var(--blue),var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; color: rgba(255,255,255,.45);
}
.staff-card-bd { padding: 1.1rem 1rem 1.25rem; }
.staff-card-bd h3 { font-size: .95rem; font-weight: 700; color: var(--blue); margin-bottom: .2rem; }
.staff-card-bd .pos { font-size: .8rem; color: var(--muted); line-height: 1.45; margin-bottom: .65rem; }
.dept-badge {
  display: inline-block; padding: .2rem .75rem;
  border-radius: 20px; font-size: .72rem; font-weight: 700;
}
.badge-general  { background: #e8eef8; color: var(--blue); }
.badge-mep      { background: #e8eef8; color: var(--blue); }
.badge-chinese  { background: #fdecea; color: #c62828; }
.badge-japanese { background: #fce4ec; color: #880e4f; }

/* ── Staff Card interactive ───────────────────────────────── */
.staff-card { cursor: pointer; transition: transform .18s, box-shadow .18s; }
.staff-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.staff-card-more { font-size: .73rem; color: var(--blue); padding: 0 1rem .85rem; opacity: .5; transition: opacity .18s; }
.staff-card:hover .staff-card-more { opacity: 1; }

/* ── Staff Modal ──────────────────────────────────────────── */
.staff-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(10,20,60,.55); backdrop-filter: blur(4px);
  z-index: 9999; align-items: center; justify-content: center; padding: 1rem;
}
.staff-modal-overlay.open { display: flex; }
.staff-modal-box {
  background: #fff; border-radius: 18px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; position: relative;
  box-shadow: 0 24px 60px rgba(10,20,60,.35);
  animation: smIn .22s ease;
}
@keyframes smIn {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.staff-modal-close {
  position: absolute; top: .75rem; right: .75rem;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(0,0,0,.18);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; line-height: 1; color: var(--text); z-index: 1;
}
.staff-modal-close:hover { background: #fff; }
.staff-modal-img { width: 100%; height: 280px; object-fit: cover; object-position: 50% 15%; border-radius: 18px 18px 0 0; display: block; }
.staff-modal-nophoto {
  width: 100%; height: 280px; border-radius: 18px 18px 0 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: none; align-items: center; justify-content: center;
  font-size: 5rem; color: rgba(255,255,255,.3);
}
.staff-modal-bd { padding: 1.5rem; }
.staff-modal-bd h2 { font-size: 1.15rem; font-weight: 800; color: var(--blue); margin-bottom: .3rem; }
.staff-modal-bd .sm-pos { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.staff-modal-sep { border: none; border-top: 1px solid #e5e7eb; margin: 1.1rem 0; }
.sm-section-title { font-size: .72rem; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }
.sm-subjects { display: flex; flex-wrap: wrap; gap: .35rem; }
.sm-subject { background: var(--bg); color: var(--blue); border-radius: 20px; padding: .2rem .75rem; font-size: .8rem; font-weight: 600; }
.sm-bio { font-size: .9rem; color: var(--text); line-height: 1.78; white-space: pre-line; }

/* ── News List ────────────────────────────────────────────── */
.news-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.pagination {
  display: flex; justify-content: center; gap: .5rem;
  margin-top: 2.5rem; flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  font-size: .875rem; text-decoration: none;
}
.pagination a { background: var(--white); color: var(--blue); box-shadow: var(--shadow); }
.pagination a:hover, .pagination .current { background: var(--blue); color: #fff; }

/* ── News Detail ──────────────────────────────────────────── */
.news-detail { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem; }
.news-detail-img { width: 100%; border-radius: var(--radius); margin-bottom: 2rem; box-shadow: var(--shadow); }
.news-detail h1 { font-size: 1.75rem; font-weight: 800; color: var(--blue); margin-bottom: .75rem; }
.news-detail-meta { color: var(--muted); font-size: .85rem; margin-bottom: 1.75rem; }
.news-detail-content { line-height: 1.85; font-size: 1rem; }
.news-detail-content p   { margin-bottom: 1rem; }
.news-detail-content img { border-radius: var(--radius-sm); margin: 1rem 0; }

/* ── Contact ──────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.contact-info h3 { font-size: 1.1rem; font-weight: 700; color: var(--blue); margin-bottom: 1.25rem; }
.contact-info .info-item { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.contact-info .info-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: #e8eef8; color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.contact-info .info-text h4 { font-size: .9rem; font-weight: 700; }
.contact-info .info-text p  { font-size: .875rem; color: var(--muted); margin-top: .15rem; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { background: var(--blue-dark); color: #fff; padding: 3rem 1.5rem 1.5rem; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.footer-brand img { height: 64px; }
.footer-brand-text h3 { font-size: 1rem; font-weight: 700; }
.footer-brand-text p  { font-size: .78rem; opacity: .65; margin-top: .25rem; line-height: 1.5; }

.footer-links h4 { font-size: .85rem; font-weight: 700; opacity: .6; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .85rem; }
.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: .45rem; }
.footer-links ul li a { color: rgba(255,255,255,.75); text-decoration: none; font-size: .875rem; transition: color .18s; }
.footer-links ul li a:hover { color: var(--yellow); }

.footer-social a {
  display: inline-flex; align-items: center; gap: .6rem;
  color: rgba(255,255,255,.8); text-decoration: none;
  font-size: .875rem; transition: color .18s;
}
.footer-social a:hover { color: var(--yellow); }
.footer-social .fb-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: #1877f2; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

.footer-bottom {
  max-width: 1200px; margin: 1.5rem auto 0;
  text-align: center; font-size: .78rem; opacity: .5;
}

/* ── Utility / Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.5rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 700;
  text-decoration: none; cursor: pointer; border: none;
  font-family: inherit; transition: all .18s;
}
.btn-primary   { background: var(--blue);  color: #fff; }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-yellow    { background: var(--yellow); color: var(--blue); }
.btn-yellow:hover { background: var(--yellow-dark); transform: translateY(-1px); }
.btn-outline   { background: transparent; border: 2px solid var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-sm { padding: .4rem 1rem; font-size: .82rem; }
.btn-danger { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; }

.badge { display: inline-block; padding: .2rem .65rem; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff8e1; color: #f57f17; }
.badge-danger  { background: #ffebee; color: #c62828; }
.badge-info    { background: #e3f2fd; color: #1565c0; }

.alert { padding: .85rem 1.2rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: .9rem; }
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.alert-danger  { background: #ffebee; color: #c62828; border-left: 4px solid #f44336; }
.alert-info    { background: #e3f2fd; color: #1565c0; border-left: 4px solid #2196f3; }

/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 700; margin-bottom: .45rem; }
.form-control {
  width: 100%; padding: .6rem .9rem;
  border: 1.5px solid #d1dae6; border-radius: var(--radius-sm);
  font-size: .9rem; font-family: inherit; background: var(--white);
  transition: border-color .18s, box-shadow .18s;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,58,143,.1); }
textarea.form-control { min-height: 130px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.25rem; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 250px; flex-shrink: 0;
  background: var(--blue-dark);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar-logo {
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.admin-sidebar-logo img { height: 38px; }
.admin-sidebar-logo span { font-size: .875rem; font-weight: 700; }

.admin-nav { padding: 1rem 0; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem;
  color: rgba(255,255,255,.72); text-decoration: none;
  font-size: .875rem; transition: all .18s;
  border-left: 3px solid transparent;
}
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--yellow); }
.admin-nav .nav-section {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; opacity: .45; padding: 1rem 1.5rem .4rem;
}
.admin-nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.admin-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.admin-topbar {
  background: var(--white);
  padding: .9rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  position: sticky; top: 0; z-index: 100;
}
.admin-topbar h1 { font-size: 1.15rem; font-weight: 800; color: var(--blue); }
.admin-user { display: flex; align-items: center; gap: .75rem; font-size: .875rem; }
.admin-user .user-name { font-weight: 700; }
.admin-user .user-role { font-size: .75rem; color: var(--muted); }
.admin-user .logout-btn { padding: .35rem .9rem; }

.admin-content { padding: 2rem; flex: 1; overflow-y: auto; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 1.4rem;
  box-shadow: 0 1px 8px rgba(0,0,0,.07);
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.si-blue   { background: #e8eef8; }
.si-yellow { background: #fff8e1; }
.si-green  { background: #e8f5e9; }
.si-red    { background: #ffebee; }
.stat-val  { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-lbl  { font-size: .78rem; color: var(--muted); margin-top: .2rem; }

/* Admin cards */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: 0 1px 8px rgba(0,0,0,.07); margin-bottom: 1.5rem;
}
.card-header {
  padding: 1.1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1.5px solid #eef0f6;
}
.card-header h2 { font-size: 1rem; font-weight: 800; color: var(--blue); }
.card-body { padding: 1.5rem; }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  padding: .7rem 1rem; text-align: left;
  font-size: .73rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: #f6f8fb; font-weight: 700;
}
.table td { padding: .85rem 1rem; border-bottom: 1px solid #eef0f6; vertical-align: middle; }
.table tbody tr:hover td { background: #f8faff; }
.table td:last-child { white-space: nowrap; }

.action-btns { display: flex; gap: .5rem; }

/* Image preview */
.img-preview { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center;
  z-index: 2000; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius);
  width: 100%; max-width: 620px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-header {
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1.5px solid #eef0f6;
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-header h2 { font-size: 1.05rem; font-weight: 800; color: var(--blue); }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.4rem; color: var(--muted); line-height: 1; padding: .2rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; display: flex; justify-content: flex-end; gap: .75rem; border-top: 1.5px solid #eef0f6; }

/* Admin login */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg,#1a3a8f,#3a1d8a);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.login-box {
  background: var(--white); border-radius: 20px;
  padding: 2.5rem; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.login-logo { height: 72px; margin: 0 auto 1rem; }
.login-box h1 { font-size: 1.2rem; font-weight: 800; color: var(--blue); margin-bottom: .25rem; }
.login-box p  { font-size: .85rem; color: var(--muted); margin-bottom: 2rem; }
.login-form { text-align: left; }

/* ── Dept card: new minimal structure ────────────────────── */
.dept-card-hd-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.dept-logo {
  width: 44px;
  height: 44px;
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.2));
}
.dept-logo-fallback {
  display: none; /* shown by JS only when img fails to load */
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  flex-shrink: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -.03em;
}
.dept-lang-initial {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .02em;
}
.dept-card-hd h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: .2rem; }
.dept-card-hd p  { font-size: .78rem; opacity: .82; }

.program-levels { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .85rem; }
.program-level  { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.level-badge {
  padding: .15rem .65rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.level-blue   { background: rgba(26,58,143,.12); color: var(--blue); }
.level-purple { background: rgba(69,39,160,.1);  color: #4527a0; }

.dept-more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue);
}
.card-chinese  .dept-more { color: #c62828; }
.card-japanese .dept-more { color: #c2185b; }

/* ── Systems section ──────────────────────────────────────── */
.sys-section {
  background: linear-gradient(160deg, #080f24 0%, #0d1d4e 50%, #1a3a8f 100%);
  padding: 5.5rem 1.5rem;
}
.sys-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.sys-feature-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: background .22s, transform .28s, border-color .22s;
}
.sys-feature-card:hover {
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-5px);
}
.sys-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow);
}
.sys-feature-body h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: .3rem; }
.sys-feature-body p  { font-size: .875rem; opacity: .7; margin-bottom: .65rem; }
.sys-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.sys-feature-list li {
  font-size: .8rem;
  opacity: .6;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.sys-feature-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}
.sys-feature-cta {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--yellow);
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Footer social icons ──────────────────────────────────── */
.footer-social h4 {
  font-size: .85rem;
  font-weight: 700;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .85rem;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: .875rem;
  transition: color .18s;
}
.social-link:hover { color: var(--yellow); }
.social-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.social-icon.facebook  { background: #1877f2; color: #fff; }
.social-icon.instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }

/* ── News card: no-image placeholder (no emoji) ───────────── */
.news-card-no-img {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
}

/* ── Checkbox group (admin forms) ────────────────────────── */
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  padding: .65rem 0;
}
.check-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  cursor: pointer;
  padding: .35rem .75rem;
  border: 1.5px solid #d1dae6;
  border-radius: 20px;
  transition: all .18s;
  user-select: none;
}
.check-label:hover { border-color: var(--blue); color: var(--blue); }
.check-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
}
.check-label:has(input:checked) {
  border-color: var(--blue);
  background: #e8eef8;
  color: var(--blue);
  font-weight: 700;
}

/* ── Staff: multiple badges ───────────────────────────────── */
.staff-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  justify-content: center;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .navbar-nav { display: none; }
  .navbar-nav.open { display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: var(--blue); padding: .75rem 1rem; gap: .25rem; }
  .navbar-nav.open a { padding: .65rem 1rem; border-radius: var(--radius-sm); }
  .hamburger { display: flex; }
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .admin-sidebar { width: 200px; }
}
@media (max-width: 600px) {
  .hero { padding: 4rem 1rem 3.5rem; }
  .hero h1 { font-size: 1.45rem; }
  .admin-sidebar { display: none; }
  .admin-sidebar.open { display: flex; position: fixed; inset: 0; width: 260px; z-index: 1000; }
  .admin-content { padding: 1.25rem; }
}
