:root {
  --ink: #0a1720;
  --ink-2: #18323a;
  --teal: #08b7a5;
  --teal-deep: #007b70;
  --teal-soft: #d8f8f2;
  --lime: #d7ff56;
  --coral: #ff6b4a;
  --sky: #77d9ff;
  --violet: #b397ff;
  --yellow: #ffe273;
  --paper: #f5f7f3;
  --white: #ffffff;
  --muted: #627078;
  --line: #d8e2df;
  --shadow: 0 18px 50px rgba(5, 49, 47, .12);
  --shadow-sm: 0 10px 28px rgba(5, 49, 47, .09);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --orange: var(--coral);
  --aqua: var(--sky);
  --cream: var(--paper);
  --primary: var(--teal);
  --primary-dark: var(--teal-deep);
  --primary-soft: var(--teal-soft);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 8%, rgba(8, 183, 165, .12), transparent 24rem),
    radial-gradient(circle at 94% 26%, rgba(215, 255, 86, .14), transparent 21rem),
    var(--paper);
  font-family: "IBM Plex Sans Thai", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .38;
  background-image: radial-gradient(rgba(10, 23, 32, .10) .7px, transparent .7px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(8, 183, 165, .28);
  outline-offset: 3px;
}
img { display: block; }

.shell { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 0 max(20px, calc((100vw - 1200px) / 2));
  background: rgba(245, 247, 243, .84);
  border-bottom: 1px solid rgba(10, 23, 32, .08);
  backdrop-filter: blur(22px) saturate(150%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.brand > strong {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(145deg, #13cbb7, #008d81);
  color: #fff;
  box-shadow: 0 9px 22px rgba(0, 123, 112, .24);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.05em;
}
.brand > strong::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  right: -17px;
  top: -15px;
  border-radius: 50%;
  background: var(--lime);
  opacity: .9;
}
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand b { font-size: 14px; font-weight: 800; letter-spacing: .11em; }
.brand small { margin-top: 7px; color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .17em; }
.header nav {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid rgba(10, 23, 32, .07);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 5px 18px rgba(6, 50, 46, .04);
}
.header nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 650;
  transition: .2s ease;
}
.header nav button:hover { background: var(--ink); color: #fff; transform: translateY(-1px); }
.nav-icon, .nav-icon svg { width: 18px; height: 18px; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.lang-toggle, .menu {
  min-width: 48px;
  height: 46px;
  border: 1px solid rgba(10, 23, 32, .12);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-weight: 800;
}
.lang-toggle:hover { background: var(--teal-soft); color: var(--teal-deep); }
.menu { display: none; font-size: 20px; }

.hero.hero-full {
  position: relative;
  height: clamp(570px, 76vh, 790px);
  min-height: 570px;
  padding: 0;
  overflow: hidden;
  background: var(--ink);
}
.hero-full .hero-slider { position: relative; width: 100%; height: 100%; overflow: hidden; }
.hero-full .hero-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--ink);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.045);
  transition: opacity .75s ease, transform 1.6s cubic-bezier(.2,.75,.2,1);
}
.hero-full .hero-card.active { opacity: 1; visibility: visible; pointer-events: auto; transform: scale(1); }
.hero-full .hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-full .shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 26, 30, .94) 0%, rgba(3, 30, 34, .77) 40%, rgba(3, 26, 30, .08) 78%),
    linear-gradient(0deg, rgba(3, 23, 28, .72), transparent 52%);
}
.hero-full::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 63%, rgba(215, 255, 86, .10));
}
.hero-info {
  position: absolute;
  z-index: 2;
  left: max(22px, calc((100vw - 1200px) / 2));
  bottom: 82px;
  width: min(760px, calc(100% - 44px));
  color: #fff;
}
.hero-semester {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(12px);
  color: #eafffb;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .14em;
}
.chip, .status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(5, 25, 30, .15);
}
.hero-info h2 {
  max-width: 820px;
  margin: 14px 0 18px;
  font-size: clamp(52px, 6.6vw, 92px);
  line-height: .98;
  letter-spacing: -.055em;
  text-shadow: 0 12px 34px rgba(0, 0, 0, .24);
}
.hero-info > p:not(.hero-semester) { margin: 5px 0; color: rgba(255, 255, 255, .86); font-size: 15px; }
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
  font-weight: 800;
  transition: .2s ease;
}
.hero-card:hover .hero-cta { transform: translateX(4px); background: #fff; }
.hero-number {
  position: absolute;
  z-index: 3;
  top: 30px;
  right: max(22px, calc((100vw - 1200px) / 2));
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(8, 183, 165, .74);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.hero-dots {
  position: absolute;
  z-index: 5;
  right: max(22px, calc((100vw - 1200px) / 2));
  bottom: 34px;
  display: flex;
  gap: 8px;
}
.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  transition: .25s ease;
}
.hero-dots button.active { width: 42px; background: var(--lime); }
.hero-hold-hint { display: none; }

.marquee {
  overflow: hidden;
  padding: 13px 0;
  border-bottom: 1px solid rgba(10, 23, 32, .10);
  background: var(--lime);
  white-space: nowrap;
}
.marquee span {
  display: block;
  width: max-content;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .20em;
  animation: marquee 23s linear infinite;
}
@keyframes marquee { to { transform: translateX(-50%); } }

.quick {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: -1px;
  padding: 34px 0 28px;
}
.quick button {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: .22s ease;
}
.quick button:hover { transform: translateY(-4px); border-color: rgba(8,183,165,.45); box-shadow: var(--shadow); }
.quick-icon {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 25px;
}
.quick button:nth-child(2) .quick-icon { background: #edf1ff; color: #654dca; }
.quick b { display: block; font-size: 19px; }
.quick small { display: block; margin-top: 4px; color: var(--muted); }

.section { padding: 46px 0 86px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-head h2 { margin: 3px 0 0; font-size: clamp(31px, 4vw, 49px); line-height: 1.08; letter-spacing: -.04em; }
.section-head > b { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; }
.section-head button { border: 0; background: transparent; color: var(--teal-deep); font-weight: 750; }
.kicker { margin: 0; color: var(--teal-deep); font-size: 10px; font-weight: 800; letter-spacing: .17em; }

.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 76px; }
.category-grid button {
  position: relative;
  height: 185px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 17px;
  border: 0;
  border-radius: var(--radius-lg);
  text-align: left;
  box-shadow: 0 12px 28px rgba(8, 35, 41, .10);
  transition: .22s ease;
}
.category-grid button::after { content: ""; position: absolute; width: 105px; height: 105px; right: -42px; top: -42px; border: 18px solid rgba(255,255,255,.32); border-radius: 50%; }
.category-grid button:hover { transform: translateY(-6px) rotate(-.5deg); box-shadow: var(--shadow); }
.cat-icon { position: relative; z-index: 1; width: 49px; height: 49px; display: grid; place-items: center; border-radius: 16px; background: rgba(255,255,255,.82); backdrop-filter: blur(8px); font-size: 22px; }
.cat-no { position: absolute; z-index: 1; right: 16px; top: 15px; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.category-grid b { position: relative; z-index: 1; max-width: 80%; font-size: 17px; line-height: 1.1; }
.category-grid b small { display: block; margin-top: 6px; font-size: 11px; font-weight: 600; opacity: .67; }
.cat-arrow { position: absolute; z-index: 1; right: 16px; bottom: 15px; font-size: 23px; transition: transform .2s ease; }
.category-grid button:hover .cat-arrow { transform: translate(3px,-3px); }

.upcoming-head { margin-top: 4px; padding-top: 42px; border-top: 1px solid var(--line); }
.upcoming-group { position: relative; margin: 0 0 34px; padding: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255, 255, 255, .82); box-shadow: var(--shadow-sm); }
.upcoming-group::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--group); }
.group-title { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; margin: 0 0 22px; }
.group-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--group); font-size: 26px; box-shadow: 0 8px 20px rgba(5,35,38,.10); }
.group-title p { margin: 0; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.group-title h3 { margin: 2px 0 0; font-size: 27px; line-height: 1.1; letter-spacing: -.03em; }
.group-title button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }

.event-grid, .group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.event-card { position: relative; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 9px 24px rgba(4, 43, 42, .08); text-align: left; transition: .25s cubic-bezier(.2,.7,.2,1); }
.event-card:hover { transform: translateY(-7px); border-color: rgba(8,183,165,.35); box-shadow: 0 20px 44px rgba(4,43,42,.15); }
.event-image { position: relative; height: 218px; overflow: hidden; background: #dce8e4; }
.event-image::after { content: ""; position: absolute; inset: auto 0 0; height: 35%; background: linear-gradient(transparent, rgba(5,20,26,.18)); }
.event-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease; }
.event-card:hover .event-image img { transform: scale(1.045); }
.event-image .status { position: absolute; z-index: 2; top: 13px; right: 13px; }
.card-index { position: absolute; z-index: 2; left: 13px; top: 13px; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); font-size: 10px; font-weight: 800; }
.status.mandatory { background: var(--coral); color: #fff; }
.status.open { background: var(--lime); }
.status.full { background: var(--ink); color: #fff; }
.status.soon { background: var(--yellow); }
.status.closed, .status.cancelled, .status.completed, .status.draft { background: #e9efed; color: var(--ink-2); }
.event-body { padding: 19px 19px 18px; }
.event-body .kicker { font-size: 9px; }
.event-body h3 { min-height: 56px; margin: 7px 0 15px; font-size: 21px; line-height: 1.23; letter-spacing: -.025em; }
.meta { display: flex; gap: 8px; margin: 6px 0; color: var(--muted); font-size: 12px; }
.event-body hr { margin: 16px 0 13px; border: 0; border-top: 1px solid var(--line); }
.event-body > span { display: flex; align-items: center; justify-content: space-between; color: var(--teal-deep); font-size: 13px; font-weight: 750; }
.event-body > span b { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); }

.page-head { padding: 70px 0 40px; }
.page-head h1 { max-width: 830px; margin: 10px 0 12px; font-size: clamp(45px, 7vw, 78px); line-height: 1.01; letter-spacing: -.06em; }
.page-head > p:last-child { max-width: 680px; color: var(--muted); font-size: 16px; }
.graphic-head { position: relative; min-height: 270px; padding-right: 150px; border-bottom: 1px solid var(--line); }
.page-symbol { position: absolute; right: 32px; top: 58px; width: 98px; height: 98px; display: grid; place-items: center; border-radius: 31px; background: linear-gradient(145deg, var(--lime), #bdec2e); box-shadow: 0 18px 42px rgba(74,110,6,.18); font-size: 42px; transform: rotate(7deg); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 25px 0 17px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: 0 0 auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.82); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.filters button.active { border-color: var(--ink); background: var(--ink); color: #fff; box-shadow: 0 7px 18px rgba(10,23,32,.16); }

.mine-search { max-width: 720px; margin: 30px 0 55px; padding: 24px; border: 1px solid rgba(8, 183, 165, .20); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--teal-soft), #f1fffb); box-shadow: var(--shadow-sm); }
.mine-search > b { display: block; margin-bottom: 10px; }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.field-row input, .login-card input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; outline: none; }
.field-row input:focus, .login-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(8,183,165,.10); }
.field-row button { min-width: 116px; padding: 0 18px; border: 0; border-radius: 15px; background: var(--teal); color: #fff; font-weight: 750; box-shadow: 0 8px 20px rgba(0,123,112,.18); }
.student-card { display: flex; align-items: center; gap: 15px; padding: 20px; border-radius: var(--radius-lg); background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: var(--lime); color: var(--ink); font-size: 23px; font-weight: 800; }
.student-card h2 { margin: 0; }
.student-card p { margin: 2px 0 0; color: #aebcc1; }
.my-list { margin: 32px 0 70px; }
.my-row { width: 100%; display: grid; grid-template-columns: 92px 1fr auto; gap: 15px; align-items: center; margin-bottom: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; text-align: left; box-shadow: 0 7px 20px rgba(4,43,42,.06); }
.my-row img { width: 92px; height: 70px; object-fit: cover; border-radius: 12px; }
.my-row b, .my-row small { display: block; }
.my-row small { color: var(--muted); }
.my-row > span:last-child { padding: 7px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-deep); font-size: 11px; font-weight: 700; }
.empty { padding: 44px 24px; border: 1px dashed #afc3bd; border-radius: var(--radius-lg); background: rgba(255,255,255,.68); text-align: center; }

.modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 18px; background: rgba(2, 17, 21, .68); backdrop-filter: blur(10px); }
.modal.open { display: grid; animation: modal-in .2s ease; }
@keyframes modal-in { from { opacity: 0; } }
.modal-box { position: relative; width: min(760px, 100%); max-height: 92vh; overflow: auto; border: 1px solid rgba(255,255,255,.22); border-radius: 28px; background: var(--paper); box-shadow: 0 30px 90px rgba(0,0,0,.33); animation: modal-card-in .3s cubic-bezier(.2,.8,.2,1); }
@keyframes modal-card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-close { position: absolute; z-index: 4; right: 14px; top: 14px; width: 42px; height: 42px; border: 1px solid rgba(10,23,32,.10); border-radius: 50%; background: rgba(255,255,255,.90); box-shadow: var(--shadow-sm); font-size: 25px; }
.detail-cover { position: relative; height: 335px; overflow: hidden; border-radius: 28px 28px 0 0; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover .shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(3,22,27,.93), rgba(3,22,27,.08) 70%); }
.detail-cover > div:last-child { position: absolute; z-index: 2; left: 26px; right: 68px; bottom: 25px; color: #fff; }
.detail-cover h2 { margin: 9px 0 2px; font-size: clamp(34px, 7vw, 54px); line-height: 1; letter-spacing: -.045em; }
.detail-content { padding: 27px; }
.detail-content > p { color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 20px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--line); }
.facts div { padding: 15px; background: #fff; }
.facts b, .facts small { display: block; }
.facts small { margin-top: 5px; color: var(--muted); }
.speaker { display: flex; align-items: center; gap: 13px; margin: 16px 0; padding: 12px; border-radius: var(--radius-md); background: #eee9ff; }
.speaker img { width: 72px; height: 72px; object-fit: cover; border-radius: 17px; }
.speaker b, .speaker small { display: block; }
.speaker small { color: #625782; }
.black-button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 50px; padding: 13px 19px; border: 0; border-radius: 15px; background: var(--ink); color: #fff; box-shadow: 0 10px 25px rgba(10,23,32,.18); font-weight: 750; transition: .2s ease; }
.black-button:hover { transform: translateY(-2px); background: var(--teal-deep); }
.black-button:disabled, button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.register-panel h2, .admin-form h2 { margin: 6px 0 18px; font-size: 34px; line-height: 1.12; letter-spacing: -.035em; }
.register-panel label { display: block; margin: 13px 0 6px; font-weight: 700; }
.student-found { display: flex; align-items: center; gap: 12px; margin-top: 13px; padding: 13px; border-radius: var(--radius-md); background: var(--teal-soft); }
.student-found b, .student-found small { display: block; }
.confirm { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; }
.confirm input { width: 20px; height: 20px; accent-color: var(--teal); }
.qr-panel { text-align: center; }
.qr-panel > img { width: 238px; height: 238px; margin: 10px auto; padding: 10px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.ticket { margin: 16px 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; text-align: left; }

.login-wrap, .setup-screen { min-height: 100vh; display: grid; place-items: center; padding: 45px 18px; background: radial-gradient(circle at 20% 20%, rgba(215,255,86,.22), transparent 25rem), linear-gradient(135deg, #032e32, #075c59 56%, #08a998); }
.login-card, .setup-card { width: min(455px, 100%); padding: 32px; border: 1px solid rgba(255,255,255,.62); border-radius: 30px; background: rgba(255,255,255,.92); box-shadow: 0 30px 80px rgba(0,25,28,.30); backdrop-filter: blur(20px); }
.setup-card { width: min(620px, 100%); }
.login-card h1, .setup-card h1 { margin: 8px 0 24px; font-size: clamp(38px, 6vw, 52px); line-height: 1.05; letter-spacing: -.05em; }
.login-card label { display: block; margin: 12px 0; font-weight: 700; }
.login-card input { margin-top: 5px; }
.admin-symbol { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 18px; background: var(--lime); font-size: 25px; transform: rotate(-5deg); }
.hint { margin-top: 15px; color: var(--muted); font-size: 10px; text-align: center; }
.setup-card code, .admin-form code { display: block; overflow: auto; margin: 16px 0; padding: 13px; border-radius: 12px; background: #eaf1ef; }

.admin-shell { width: min(1200px, calc(100% - 40px)); margin: auto; padding: 48px 0 84px; }
.admin-top { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.admin-top h1 { margin: 3px 0 0; font-size: clamp(34px, 5vw, 49px); line-height: 1.1; letter-spacing: -.045em; }
.admin-top button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 25px 0; }
.stat { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid rgba(10,23,32,.07); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.stat:nth-child(1) { background: var(--teal); color: #fff; }
.stat:nth-child(2) { background: var(--lime); }
.stat:nth-child(3) { background: var(--sky); }
.stat:nth-child(4) { background: var(--violet); }
.stat span { font-size: 12px; font-weight: 650; }
.stat b { font-size: 38px; line-height: 1; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 22px; }
.admin-actions button, .row-actions button, .dialog-heading > button { padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-weight: 700; box-shadow: 0 5px 15px rgba(4,43,42,.06); }
.admin-actions button:first-child { background: var(--ink); color: #fff; }
.registration-roster-menu { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; margin: 0 0 20px; padding: 17px 18px; border: 1px solid #b5dc38; border-radius: var(--radius-lg); background: var(--lime); color: var(--ink); text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); }
.registration-roster-menu:hover { transform: translateY(-1px); box-shadow: 0 11px 28px rgba(4,43,42,.12); }
.registration-roster-menu-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: #fff; font-size: 23px; }
.registration-roster-menu b, .registration-roster-menu small { display: block; }
.registration-roster-menu b { font-size: 17px; }
.registration-roster-menu small { margin-top: 3px; color: var(--ink-2); line-height: 1.4; }
.registration-roster-menu strong { white-space: nowrap; }
.admin-table { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255,255,255,.86); box-shadow: var(--shadow-sm); }
.admin-row { display: grid; grid-template-columns: 58px minmax(210px, 1fr) auto auto; align-items: center; gap: 13px; padding: 12px 0; border-top: 1px solid var(--line); }
.admin-row:first-child { border-top: 0; }
.admin-row img { width: 58px; height: 53px; object-fit: cover; border-radius: 12px; }
.admin-row b, .admin-row small { display: block; }
.admin-row small { color: var(--muted); }
.admin-badges, .row-actions { display: flex; align-items: center; gap: 7px; }
.row-actions button { padding: 7px 10px; box-shadow: none; }
.row-actions .danger { border-color: #ffd5cb; background: #fff0ec; color: #ba3e22; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label, .drop-file { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.form-grid textarea { min-height: 100px; resize: vertical; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .check-label { flex-direction: row; align-items: center; }
.form-grid .check-label input { width: 20px; height: 20px; accent-color: var(--teal); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 21px; }
.form-actions > button:first-child { padding: 10px 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.drop-file { margin: 18px 0; padding: 22px; border: 1px dashed #82aca4; border-radius: var(--radius-md); background: var(--teal-soft); }
.import-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 15px; padding: 15px; border-radius: var(--radius-md); background: var(--lime); }
.import-summary b { font-size: 35px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0; }
.registration-table { margin-top: 18px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.registration-table > div { display: grid; grid-template-columns: 130px 150px minmax(220px,1fr) 150px; min-width: 680px; }
.registration-table > div > * { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.registration-table .reg-head { background: var(--ink); color: #fff; }
.registration-roster { width: min(1180px, 100%); }
.modal-box:has(.registration-roster) { width: min(1240px, 100%); }
.registration-category-list { display: grid; gap: 18px; margin-top: 20px; }
.registration-category-group { padding: 15px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.72); }
.registration-category-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; margin-bottom: 12px; padding-bottom: 11px; border-bottom: 3px solid var(--category-color); }
.registration-category-heading > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--category-color); font-size: 20px; }
.registration-category-heading p, .registration-category-heading h3 { margin: 0; }
.registration-category-heading p { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.registration-category-heading h3 { margin-top: 2px; font-size: 18px; }
.registration-category-heading small { padding: 6px 10px; border-radius: 999px; background: var(--category-color); font-weight: 750; white-space: nowrap; }
.registration-count-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 10px; }
.registration-count-grid > button { min-height: 112px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #edf6f3; text-align: left; cursor: pointer; }
.registration-count-grid > button:hover { border-color: #76baaf; background: var(--teal-soft); }
.registration-count-grid span, .registration-count-grid small { display: block; }
.registration-count-grid span { min-height: 38px; font-weight: 750; line-height: 1.3; }
.registration-count-grid b { display: block; margin-top: 7px; font-size: 28px; line-height: 1; }
.registration-count-grid small { margin-top: 3px; color: var(--muted); }
.registration-roster-filters { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; margin-top: 16px; padding: 15px; border-radius: var(--radius-md); background: #edf6f3; }
.registration-roster-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 750; }
.registration-roster-filters select, .registration-roster-filters input { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.registration-roster-table { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.registration-roster-table > div { display: grid; grid-template-columns: 70px 145px minmax(180px,1fr) minmax(220px,1.2fr) 180px 90px; align-items: center; min-width: 930px; }
.registration-roster-table > div > * { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.registration-roster-table .registration-roster-head { position: sticky; top: 0; z-index: 1; background: var(--ink); color: #fff; }
.registration-roster-table .student-empty { display: block; min-width: 100%; padding: 28px; text-align: center; color: var(--muted); }
.cancel-registration { padding: 8px 11px; border: 1px solid #ffd0c5; border-radius: 11px; background: #fff0ec; color: #a9311b; font-weight: 750; cursor: pointer; }
.cancel-registration:hover { background: #ffddd5; }
.student-directory { width: min(1180px, 100%); }
.modal-box:has(.student-directory) { width: min(1240px, 100%); }
.student-filters { display: grid; grid-template-columns: 1.3fr .7fr 1fr; gap: 12px; margin-top: 20px; padding: 15px; border-radius: var(--radius-md); background: #edf6f3; }
.student-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 750; }
.student-filters select, .student-filters input { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.directory-summary { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; }
.directory-summary span { display: flex; align-items: baseline; gap: 6px; padding: 8px 13px; border-radius: 999px; background: var(--lime); font-size: 12px; font-weight: 650; }
.directory-summary span:nth-child(2) { background: var(--sky); }
.directory-summary b { font-size: 20px; }
.student-table { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.student-table > div { display: grid; grid-template-columns: 75px 130px minmax(190px,1fr) minmax(210px,1fr) minmax(180px,1fr) 90px 135px; min-width: 1080px; }
.student-table > div > * { min-width: 0; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.student-table .student-head { position: sticky; top: 0; z-index: 1; background: var(--ink); color: #fff; }
.student-table span b, .student-table span small { display: block; }
.student-table span small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.student-table .student-empty { display: block; min-width: 100%; padding: 28px; text-align: center; color: var(--muted); }
.check-error { margin-top: 12px; border: 0; background: #ffe5de; color: #a92f17; }
.check-warn { margin-top: 12px; border: 0; background: #fff2c1; }
.check-ok { margin-top: 12px; border: 0; background: var(--teal-soft); color: var(--teal-deep); }

.toast { position: fixed; z-index: 100; top: 95px; left: 50%; max-width: calc(100% - 32px); padding: 12px 17px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.24); opacity: 0; pointer-events: none; transform: translate(-50%, -14px); transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 26px; padding: 38px max(20px, calc((100vw - 1200px) / 2)); background: var(--ink); color: #fff; }
footer .brand > strong { background: var(--teal); }
footer .brand small { color: #9caeb3; }
footer > button { padding: 9px 13px; border: 1px solid #40525a; border-radius: 999px; background: transparent; color: #c9d4d7; }
.mobile-nav { display: none; }

@media (max-width: 960px) {
  .event-grid, .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero-full .shade { background: linear-gradient(90deg, rgba(3,26,30,.92), rgba(3,30,34,.58) 58%, rgba(3,26,30,.18)); }
}

@media (max-width: 700px) {
  body { background: var(--paper); }
  .shell { width: min(100% - 28px, 1200px); }
  .header { height: 70px; padding: 0 14px; }
  .brand > strong { width: 46px; height: 46px; border-radius: 14px; font-size: 16px; }
  .brand b { font-size: 12px; }
  .brand small { font-size: 7px; }
  .header nav { position: absolute; top: 64px; left: 14px; right: 14px; display: none; flex-direction: column; align-items: stretch; padding: 9px; border-radius: 19px; background: rgba(255,255,255,.97); box-shadow: var(--shadow); }
  .header nav.open { display: flex; }
  .header nav button { justify-content: flex-start; }
  .menu { display: block; }
  .lang-toggle, .menu { height: 42px; min-width: 44px; border-radius: 13px; }
  .hero.hero-full { height: 610px; min-height: 610px; }
  .hero-full .shade { background: linear-gradient(0deg, rgba(3,23,28,.94) 0%, rgba(3,26,30,.57) 60%, rgba(3,26,30,.13)); }
  .hero-info { left: 20px; right: 20px; bottom: 66px; width: auto; }
  .hero-info h2 { margin-top: 12px; font-size: clamp(42px, 12vw, 57px); line-height: 1; }
  .hero-info > p:not(.hero-semester) { font-size: 13px; }
  .hero-semester { margin-bottom: 10px; font-size: 9px; }
  .hero-number { top: 18px; right: 18px; width: 50px; height: 50px; }
  .hero-dots { left: 20px; right: auto; bottom: 26px; }
  .hero-cta { margin-top: 17px; padding: 11px 15px; }
  .marquee { padding: 11px 0; }
  .quick { grid-template-columns: 1fr; gap: 10px; padding: 20px 0 14px; }
  .quick button { min-height: 82px; padding: 13px; border-radius: 19px; }
  .quick-icon { width: 52px; height: 52px; border-radius: 16px; }
  .section { padding: 34px 0 72px; }
  .section-head h2 { font-size: 33px; }
  .category-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 55px; }
  .category-grid button { height: 155px; border-radius: 20px; }
  .category-grid button:last-child { grid-column: 1 / -1; height: 135px; }
  .cat-icon { width: 43px; height: 43px; border-radius: 14px; }
  .upcoming-head { padding-top: 31px; }
  .upcoming-group { margin-bottom: 23px; padding: 16px; border-radius: 24px; }
  .group-title { grid-template-columns: auto 1fr; gap: 11px; }
  .group-title button { display: none; }
  .group-icon { width: 49px; height: 49px; border-radius: 15px; font-size: 22px; }
  .group-title h3 { font-size: 23px; }
  .event-grid, .group-grid { grid-template-columns: 1fr; }
  .event-card { border-radius: 21px; }
  .event-image { height: 220px; }
  .page-head { padding: 48px 0 28px; }
  .page-head h1 { font-size: 45px; }
  .graphic-head { min-height: 230px; padding-right: 72px; }
  .graphic-head > p:last-child { padding-right: 20px; font-size: 14px; }
  .page-symbol { width: 58px; height: 58px; right: 4px; top: 52px; border-radius: 19px; font-size: 28px; }
  .filters { padding-top: 18px; }
  .mine-search { margin-top: 20px; padding: 16px; border-radius: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .field-row button { min-height: 48px; }
  .my-row { grid-template-columns: 78px 1fr; }
  .my-row img { width: 78px; height: 66px; }
  .my-row > span:last-child { display: none; }
  .modal { padding: 10px; }
  .modal-box { max-height: 95vh; border-radius: 23px; }
  .detail-cover { height: 275px; border-radius: 23px 23px 0 0; }
  .detail-cover h2 { font-size: 37px; }
  .detail-content { padding: 20px; }
  .facts { grid-template-columns: 1fr; }
  .facts div { padding: 12px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .student-filters { grid-template-columns: 1fr; }
  .dialog-heading { align-items: flex-start; }
  .dialog-heading > button { flex: 0 0 auto; }
  .stats { gap: 9px; }
  .stat { min-height: 110px; padding: 14px; border-radius: 19px; }
  .stat b { font-size: 31px; }
  .admin-shell { width: calc(100% - 28px); padding-top: 30px; }
  .admin-top { align-items: flex-start; }
  .admin-top h1 { font-size: 32px; }
  .admin-row { grid-template-columns: 52px 1fr; }
  .admin-row > .admin-badges, .admin-row > .row-actions { grid-column: 2; }
  footer { grid-template-columns: 1fr; padding: 31px 18px 105px; }
  footer > button { width: fit-content; }
  .mobile-nav { position: fixed; z-index: 35; left: 12px; right: 12px; bottom: max(11px, env(safe-area-inset-bottom)); height: 67px; display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; padding: 5px; border: 1px solid rgba(255,255,255,.14); border-radius: 22px; background: rgba(10,23,32,.94); box-shadow: 0 20px 48px rgba(0,0,0,.26); backdrop-filter: blur(18px); }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 17px; background: transparent; color: #8ea0a7; }
  .mobile-nav button span { font-size: 10px; }
  .mobile-nav button.active { background: rgba(8,183,165,.17); color: #dffff8; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.checkin-action {
  min-height: 42px;
  padding: 9px 13px;
  border: 0;
  border-radius: 13px;
  background: var(--teal);
  color: #fff;
  font-weight: 750;
  white-space: nowrap;
}
.checked-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.checkin-panel label { display: flex; flex-direction: column; gap: 7px; margin: 16px 0; font-weight: 750; }
.checkin-panel input { width: 100%; min-height: 54px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 18px; letter-spacing: .12em; }
.success-panel { text-align: center; }
.success-mark { display: grid; place-items: center; width: 70px; height: 70px; margin: 0 auto 15px; border-radius: 22px; background: var(--lime); color: var(--ink); font-size: 34px; font-weight: 800; transform: rotate(-4deg); }
.location-note { margin: 12px 0 16px; padding: 12px 14px; border-radius: 13px; background: #edf6f3; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.location-note.locating { background: #e8f7ff; color: #175a76; }
.location-note.location-ok { background: var(--teal-soft); color: var(--teal-deep); }
.location-note.location-error { background: #ffe5de; color: #a92f17; }
.checkin-settings { padding: 17px; border: 1px solid #9bd9cf; border-radius: var(--radius-md); background: var(--teal-soft); }
.checkin-settings-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.checkin-settings-head b, .checkin-settings-head small { display: block; }
.checkin-settings-head small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.checkin-settings-head button { padding: 9px 12px; border: 1px solid #7fc9bd; border-radius: 12px; background: #fff; font-weight: 750; white-space: nowrap; }
.checkin-grid { display: grid; grid-template-columns: 1fr .7fr 1fr 1fr; gap: 11px; }
.attendance-report { width: min(1180px, 100%); }
.modal-box:has(.attendance-report) { width: min(1240px, 100%); }
.export-actions { display: flex; gap: 8px; }
.export-actions button { padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-weight: 750; }
.export-actions button:first-child { background: var(--ink); color: #fff; }
.attendance-filters { display: grid; grid-template-columns: 1.5fr .65fr .65fr; gap: 12px; margin-top: 20px; padding: 15px; border-radius: var(--radius-md); background: #edf6f3; }
.attendance-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 750; }
.attendance-filters select { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.attendance-table { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.attendance-table > div { display: grid; grid-template-columns: 70px 130px minmax(200px,1fr) 90px 85px 100px 125px 80px 58px; min-width: 1040px; }
.attendance-table > div > * { min-width: 0; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.attendance-table .attendance-head { position: sticky; top: 0; z-index: 1; background: var(--ink); color: #fff; }
.attendance-table .student-empty { display: block; min-width: 100%; padding: 28px; text-align: center; color: var(--muted); }
.attendance-delete-cell { display: grid; place-items: center; padding: 6px !important; }
.attendance-delete { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #ffd5cb; border-radius: 10px; background: #fff0ec; cursor: pointer; font-size: 16px; transition: transform .15s ease, background .15s ease; }
.attendance-delete:hover { background: #ffddd5; transform: translateY(-1px); }
.attendance-delete:focus-visible { outline: 3px solid rgba(186,62,34,.22); outline-offset: 2px; }

@media (max-width: 700px) {
  .registration-roster-menu { grid-template-columns: auto 1fr; }
  .registration-roster-menu strong { grid-column: 2; }
  .registration-category-heading { grid-template-columns: auto 1fr; }
  .registration-category-heading small { grid-column: 2; justify-self: start; }
  .my-row { grid-template-columns: 70px minmax(0,1fr); }
  .my-row .checkin-action, .my-row > span.checked-pill { grid-column: 2; display: inline-flex; justify-content: center; width: fit-content; }
  .checkin-settings-head, .dialog-heading { flex-direction: column; align-items: stretch; }
  .checkin-grid, .attendance-filters, .registration-roster-filters { grid-template-columns: 1fr; }
  .export-actions { width: 100%; }
  .export-actions button { flex: 1; }
}
