/* รูปแบบการแสดงผลร่วมกัน: ตัวแปร สี โครงหน้า คอมโพเนนต์ และหน้าจอขนาดต่าง ๆ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {

  --orange: #f15a0a;

  --ink: #272832;

  --muted: #858995;

  --line: #e9eaf0;

  --bg: #f7f8fb;

  --white: #fff;

  --sidebar: 228px;

}

/* ตั้งค่าพื้นฐานของเอกสาร สี และตัวอักษร */
* {

  box-sizing: border-box;

}

body {

  margin: 0;

  background: var(--bg);

  color: var(--ink);

  font: 14px 'IBM Plex Sans Thai',sans-serif;

}

button,input,select,textarea {

  font: inherit;

}

button,a {

  cursor: pointer;

}

a {

  text-decoration: none;

  color: inherit;

}

/* แถบนำทางด้านบนและข้อมูลบัญชีผู้ใช้ */
.topbar {

  height: 64px;

  background: var(--orange);

  color: white;

  display: flex;

  align-items: center;

  gap: 13px;

  padding: 0 22px;

  position: fixed;

  z-index: 20;

  inset: 0 0 auto;

  box-shadow: 0 4px 18px #bd460e22;

}

.brand {

  display: flex;

  align-items: center;

  gap: 10px;

}

.brand-mark {

  width: 40px;

  height: 40px;

  display: grid;

  place-items: center;

  border-radius: 11px;

  background: #ffffff24;

  font-size: 24px;

}

.brand b {

  font: 800 14px Manrope,sans-serif;

  letter-spacing: .4px;

  display: block;

}

.brand small {

  display: block;

  font-size: 10px;

  opacity: .9;

}

.top-actions {

  margin-left: auto;

  display: flex;

  align-items: center;

  gap: 18px;

}

.top-icon {

  position: relative;

  font-size: 22px;

}

.top-icon i {

  position: absolute;

  width: 7px;

  height: 7px;

  background: #ffe17b;

  border: 1px solid var(--orange);

  border-radius: 50%;

  top: 0;

  right: -2px;

}

.profile-trigger {

  display: flex;

  align-items: center;

  gap: 9px;

  background: transparent;

  border: 0;

  color: white;

}

.avatar {

  width: 34px;

  height: 34px;

  display: grid;

  place-items: center;

  background: #ffe1cd;

  color: #8e3510;

  border-radius: 50%;

  font-weight: 700;

}

.mobile-menu {

  display: none;

  background: transparent;

  border: 0;

  color: white;

  font-size: 22px;

}

/* เมนูนำทางด้านข้าง */
.sidebar {

  position: fixed;

  z-index: 15;

  left: 0;

  top: 64px;

  bottom: 0;

  width: var(--sidebar);

  background: #fffaf0;

  border-right: 1px solid var(--line);

  padding: 22px 12px 13px;

  display: flex;

  flex-direction: column;

}

.nav-label,.eyebrow {

  font: 700 10px Manrope,sans-serif;

  letter-spacing: 1px;

  color: #a0a3ad;

}

.nav-label {

  padding: 0 12px 13px;

}

.nav-item > span,

.nav-item > svg,

.nav-item > i {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    width: 22px;

    height: 22px;

}

.nav-item > svg {

    stroke-width: 1.8;

}

.nav-item {

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 11px 12px;

  border-radius: 9px;

  color: #686b75;

  margin-bottom: 4px;

  font-weight: 500;

  font-size: 12px;

}

.nav-item>span {

  width: 21px;

  text-align: center;

  font-size: 18px;

}

.nav-item:hover {

  background: #fff0e6;

  color: var(--orange);

}

.nav-item.active {

  background: var(--orange);

  color: white;

}

.nav-item em {

  font-style: normal;

  margin-left: auto;

  font-size: 10px;

  background: #ffffff35;

  border-radius: 20px;

  padding: 2px 7px;

}

.sidebar-bottom {

  margin-top: auto;

}

.help-card {

  background: #fff5ee;

  border: 1px solid #ffe3d2;

  border-radius: 12px;

  padding: 13px;

  margin-bottom: 13px;

}

.help-icon {

  display: grid;

  place-items: center;

  background: #ffe2cf;

  color: var(--orange);

  width: 28px;

  height: 28px;

  border-radius: 8px;

  margin-bottom: 8px;

}

.help-card b {

  font-size: 11px;

}

.help-card p {

  font-size: 10px;

  color: var(--muted);

  line-height: 1.6;

}

.help-card a {

  color: var(--orange);

  font-size: 10px;

  font-weight: 700;

}

.sidebar-user {

  border-top: 1px solid var(--line);

  padding: 12px 3px 2px;

  display: flex;

  gap: 9px;

  align-items: center;

}

.sidebar-user b,.sidebar-user small {

  display: block;

}

.sidebar-user b {

  font-size: 10px;

}

.sidebar-user small {

  font-size: 9px;

  color: var(--muted);

  margin-top: 3px;

}

/* โครงพื้นที่เนื้อหาหลักของแต่ละหน้า */
.main-content {

  margin: 64px 0 0 var(--sidebar);

  padding: 30px clamp(18px,3.7vw,48px) 42px;

  min-height: calc(100vh - 64px);

}

.page-wrap {

  max-width: 1280px;

  margin: auto;

}

.welcome-row,.page-heading,.section-head {

  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 18px;

}

.welcome-row h1,.page-heading h1 {

  font-size: 27px;

  line-height: 1.35;

  margin: 0 0 5px;

  letter-spacing: -.4px;

}

.eyebrow {

  color: var(--orange);

  margin-bottom: 7px;

}

.muted,.page-heading p,.section-head p {

  color: var(--muted);

  font-size: 11px;

  margin: 0;

  line-height: 1.7;

}

.orange {

  color: var(--orange);

}

.date-chip {

  background: #fff;

  border: 1px solid var(--line);

  padding: 9px 12px;

  border-radius: 10px;

  font-size: 10px;

  color: #777;

}

/* แบนเนอร์หลักและปุ่มที่ใช้ร่วมกัน */
.hero {

  margin-top: 23px;

  min-height: 240px;

  border-radius: 20px;

  padding: 28px 34px;

  position: relative;

  overflow: hidden;

  background: linear-gradient(110deg,#ed5205,#f77735 65%,#ffa16b);

  color: white;

  display: flex;

  align-items: center;

  box-shadow: 0 14px 35px #f15a0a1c;

}

.hero:after {

  content: "";

  position: absolute;

  width: 310px;

  height: 310px;

  border: 1px solid #ffffff30;

  border-radius: 50%;

  right: 9%;

  top: -40px;

  box-shadow: 0 0 0 35px #ffffff0b,0 0 0 75px #ffffff09;

}

.hero h2 {

  font-size: 29px;

  line-height: 1.35;

  margin: 13px 0 8px;

}

.hero p {

  font-size: 11px;

  line-height: 1.8;

  color: #fff1e9;

  max-width: 370px;

  margin: 0 0 17px;

}

.pill {

  font: 700 9px Manrope,sans-serif;

  letter-spacing: .7px;

  background: #ffffff24;

  border: 1px solid #ffffff4a;

  border-radius: 30px;

  padding: 7px 10px;

}

.hero-art {

  position: absolute;

  right: 12%;

  top: 50%;

  transform: translateY(-50%) rotate(7deg);

  z-index: 2;

  width: 125px;

  height: 155px;

  border-radius: 18px;

  background: #fffaf6;

  color: var(--orange);

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  font-size: 58px;

  box-shadow: 0 18px 35px #a83d1233;

}

.hero-art small {

  font: 800 8px Manrope,sans-serif;

  letter-spacing: 1px;

  margin-top: 7px;

}

.button {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 7px;

  padding: 9px 13px;

  border-radius: 9px;

  border: 1px solid transparent;

  font-weight: 700;

  font-size: 10px;

}

.button.white {

  background: white;

  color: #d94a00;

}

.button.primary {

  background: var(--orange);

  color: white;

}

.button.outline {

  background: white;

  border-color: var(--line);

  color: #656a75;

}

/* ส่วนเนื้อหา หมวดหมู่ และการ์ดในหน้าแรก */
.section {

  margin-top: 31px;

}

.section-head {

  margin-bottom: 15px;

}

.section-head h2 {

  font-size: 19px;

  margin: 0 0 4px;

}

.text-link {

  color: var(--orange);

  font-size: 10px;

  font-weight: 700;

  white-space: nowrap;

  border: 0;

  background: none;

}

.category-grid {

  display: grid;

  grid-template-columns: repeat(4,minmax(0,1fr));

  gap: 12px;

}

.category-card {

  display: flex;

  align-items: center;

  gap: 10px;

  background: white;

  border: 1px solid var(--line);

  border-radius: 13px;

  padding: 14px 12px;

  text-align: left;

  transition: .2s;

}

.category-card:hover,.benefit-card:hover {

  transform: translateY(-2px);

  box-shadow: 0 9px 26px #20232b0b;

  border-color: #ffd1b8;

}

.category-icon,.benefit-icon {

  width: 40px;

  height: 40px;

  display: grid;

  place-items: center;

  border-radius: 11px;

  font-size: 21px;

  flex-shrink: 0;

}

.category-info {

  min-width: 0;

  flex: 1;

}

.category-info b,.category-info small {

  display: block;

}

.category-info b {

  font-size: 11px;

}

.category-info small {

  font-size: 9px;

  color: var(--muted);

  margin-top: 4px;

}

.amber {

  background: #fff3d9;

  color: #c78b14;

}

.rose {

  background: #ffe9ed;

  color: #e35b74;

}

.violet {

  background: #f0eaff;

  color: #8461d6;

}

.blue {

  background: #e6f2ff;

  color: #4789ce;

}

.green {

  background: #e6f7ee;

  color: #3b9d6b;

}

.benefit-grid {

  display: grid;

  grid-template-columns: repeat(3,minmax(0,1fr));

  gap: 13px;

}

/* การ์ดแสดงสิทธิประโยชน์ */
.benefit-card {

  background: white;

  border: 1px solid var(--line);

  border-radius: 14px;

  padding: 16px;

  display: flex;

  flex-direction: column;

  min-width: 0;

  transition: .2s;

}

.card-top {

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 10px;

}

.save-button {

  width: 30px;

  height: 30px;

  border: 1px solid var(--line);

  background: white;

  border-radius: 9px;

  color: #9a9da6;

  font-size: 17px;

}

.save-button.saved {

  color: var(--orange);

  background: #fff1e7;

  border-color: #ffd5bd;

}

.category-label {

  font: 700 9px Manrope,sans-serif;

  color: #a0a3ad;

  letter-spacing: .8px;

}

.benefit-card h3 {

  font-size: 13px;

  line-height: 1.6;

  margin: 7px 0;

}

.benefit-card>p {

  font-size: 10px;

  color: var(--muted);

  line-height: 1.8;

  margin: 0 0 15px;

  flex: 1;

}

.card-bottom {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 7px;

  border-top: 1px solid #f0f0f3;

  padding-top: 10px;

}

.card-bottom small {

  font-size: 9px;

  color: #9296a0;

}

.tip {

  margin-top: 24px;

  padding: 15px 18px;

  display: flex;

  align-items: center;

  gap: 12px;

  background: #fff7f0;

  border: 1px solid #ffe1ce;

  border-radius: 13px;

}

.tip-icon {

  display: grid;

  place-items: center;

  width: 39px;

  height: 39px;

  border-radius: 11px;

  background: #ffe5d4;

  color: var(--orange);

  font-size: 19px;

}

.tip>div:nth-child(2) {

  flex: 1;

}

.tip b {

  font-size: 11px;

}

.tip p {

  font-size: 10px;

  color: var(--muted);

  margin: 4px 0 0;

}

.page-heading {

  margin-bottom: 23px;

}

.page-heading h1 {

  font-size: 26px;

}

.count {

  background: white;

  border: 1px solid var(--line);

  border-radius: 11px;

  padding: 7px 13px;

  text-align: center;

  min-width: 77px;

}

.count b,.count small {

  display: block;

}

.count b {

  font: 800 20px Manrope,sans-serif;

  color: var(--orange);

}

.count small {

  font-size: 9px;

  color: var(--muted);

}

.toolbar {

  display: flex;

  gap: 9px;

  margin-bottom: 12px;

}

/* ช่องค้นหาและเครื่องมือควบคุมรายการ */
.search {

  display: flex;

  align-items: center;

  gap: 9px;

  flex: 1;

  min-width: 0;

  background: white;

  border: 1px solid var(--line);

  border-radius: 10px;

  padding: 0 12px;

  height: 42px;

  color: #999;

  font-size: 19px;

}

.search input {

  border: 0;

  outline: 0;

  background: transparent;

  flex: 1;

  min-width: 0;

  font-size: 11px;

  color: var(--ink);

}

.toolbar select {

  border: 1px solid var(--line);

  background: white;

  border-radius: 10px;

  padding: 0 11px;

  color: #666;

  font-size: 10px;

}

.filter-row {

  display: flex;

  flex-wrap: wrap;

  gap: 7px;

  margin: 12px 0 18px;

}

.filter-chip {

  border: 1px solid var(--line);

  background: white;

  color: #747985;

  border-radius: 25px;

  padding: 7px 12px;

  font-size: 10px;

}

.filter-chip.selected {

  background: #fff0e6;

  color: var(--orange);

  border-color: #ffd3bb;

  font-weight: 700;

}

.filter-panel {

  padding: 15px;

  background: white;

  border: 1px solid var(--line);

  border-radius: 13px;

  margin-bottom: 14px;

}

.filter-panel b {

  font-size: 11px;

}

.filter-panel .filter-row {

  margin: 9px 0;

}

.hidden {

  display: none!important;

}

.empty {

  background: white;

  border: 1px dashed #dddfe6;

  border-radius: 15px;

  text-align: center;

  padding: 50px 18px;

  color: var(--muted);

  font-size: 12px;

}

.favorite-search {

  max-width: 520px;

  margin-bottom: 18px;

}

.empty-heart {

  margin: auto;

  background: #fff0e6;

  color: var(--orange);

  width: 53px;

  height: 53px;

  border-radius: 16px;

  display: grid;

  place-items: center;

  font-size: 27px;

}

.empty h3 {

  color: var(--ink);

  margin: 12px 0 6px;

}

.empty p {

  font-size: 11px;

  margin-bottom: 15px;

}

/* แท็บสำหรับกรองรายการ */
.tabs {

  display: flex;

  gap: 20px;

  border-bottom: 1px solid var(--line);

  margin-bottom: 16px;

}

.tabs button {

  border: 0;

  background: transparent;

  padding: 11px 4px;

  color: #858995;

  position: relative;

  font-size: 11px;

}

.tabs button.active {

  color: var(--orange);

  font-weight: 700;

}

.tabs button.active:after {

  content: "";

  position: absolute;

  bottom: -1px;

  left: 0;

  right: 0;

  height: 3px;

  border-radius: 3px;

  background: var(--orange);

}

.tab-count {

  background: #fff0e6;

  color: var(--orange);

  border-radius: 15px;

  padding: 2px 6px;

  font-size: 9px;

  margin-left: 4px;

}

/* รายการแจ้งเตือนและสถานะการอ่าน */
.notification-list {

  display: grid;

  gap: 10px;

}

.notification-card {

  display: flex;

  align-items: flex-start;

  gap: 13px;

  background: white;

  border: 1px solid var(--line);

  border-radius: 13px;

  padding: 15px;

}

.notification-card.unread {

  background: #fffaf6;

  border-color: #ffe3d1;

}

.notification-copy {

  flex: 1;

}

.notification-meta {

  font: 700 9px Manrope,sans-serif;

  letter-spacing: .6px;

  color: #9b9ea8;

}

.notification-meta i {

  font-style: normal;

  letter-spacing: 0;

  background: #ffeadc;

  color: var(--orange);

  padding: 3px 7px;

  border-radius: 20px;

  margin-left: 5px;

}

.notification-copy h3 {

  font-size: 12px;

  margin: 6px 0;

}

.notification-copy p {

  font-size: 10px;

  line-height: 1.8;

  color: var(--muted);

  margin: 0 0 7px;

}

.notification-copy small {

  font-size: 9px;

  color: #a4a7b0;

}

.notification-card>button {

  border: 0;

  background: transparent;

  color: #aaa;

  font-size: 20px;

}

/* โครงหน้าสนทนาและแผงช่วยเหลือ */
.assistant-layout {

  display: grid;

  grid-template-columns: minmax(0,1fr) 250px;

  gap: 15px;

}

.chat-panel,.side-panel,.side-note {

  background: white;

  border: 1px solid var(--line);

  border-radius: 14px;

  overflow: hidden;

}

.chat-head {

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 14px 16px;

  border-bottom: 1px solid var(--line);

}

.bot-icon {

  display: grid;

  place-items: center;

  width: 36px;

  height: 36px;

  background: #fff0e6;

  color: var(--orange);

  border-radius: 11px;

  font-size: 19px;

}

.chat-head b,.chat-head small {

  display: block;

}

.chat-head b {

  font-size: 11px;

}

.chat-head small {

  font-size: 9px;

  color: #5ba97b;

  margin-top: 4px;

}

.ai-label {

  margin-left: auto;

  font: 700 9px Manrope,sans-serif;

  color: #a3a6ae;

  letter-spacing: .7px;

}

.chat-messages {

  padding: 16px;

  min-height: 290px;

  max-height: 400px;

  overflow: auto;

  display: flex;

  flex-direction: column;

  gap: 11px;

}

.message {

  display: flex;

  gap: 8px;

  max-width: 88%;

  align-items: flex-start;

}

.message.user {

  align-self: flex-end;

  flex-direction: row-reverse;

}

.message-badge {

  width: 25px;

  height: 25px;

  border-radius: 8px;

  display: grid;

  place-items: center;

  background: #fff0e6;

  color: var(--orange);

  flex-shrink: 0;

}

.message.user .message-badge {

  background: #e9eef8;

  color: #5678aa;

}

.bubble {

  padding: 10px 12px;

  background: #f5f6f9;

  border-radius: 4px 11px 11px 11px;

  font-size: 10px;

  line-height: 1.8;

  white-space: pre-wrap;

}

.message.user .bubble {

  background: #fff0e6;

  border-radius: 11px 4px 11px 11px;

}

.suggestions {

  padding: 0 16px 13px 49px;

  display: grid;

  gap: 6px;

}

.suggestions small {

  color: #999da7;

  font-size: 9px;

}

.suggestions button {

  text-align: left;

  border: 1px solid var(--line);

  background: white;

  border-radius: 8px;

  padding: 8px 10px;

  font-size: 10px;

  color: #686d78;

}

.suggestions button:hover {

  border-color: #ffc7a7;

  color: var(--orange);

}

.composer {

  border-top: 1px solid var(--line);

  padding: 11px;

  display: flex;

  gap: 8px;

}

.composer input {

  flex: 1;

  min-width: 0;

  border: 1px solid var(--line);

  border-radius: 9px;

  padding: 11px;

  background: #fbfbfc;

  font-size: 10px;

}

.send {

  width: 39px;

  border: 0;

  border-radius: 9px;

  background: var(--orange);

  color: white;

  font-size: 17px;

}

.disclaimer {

  text-align: center;

  font-size: 9px;

  color: #a1a4ad;

  padding: 0 12px 11px;

}

.assistant-side {

  display: flex;

  flex-direction: column;

  gap: 11px;

}

.side-panel,.side-note {

  padding: 15px;

}

.side-panel h3 {

  font-size: 12px;

  margin: 11px 0 6px;

}

.side-panel p,.side-note p {

  font-size: 10px;

  color: var(--muted);

  line-height: 1.8;

}

.capability {

  padding: 9px 0;

  border-top: 1px solid #f0f0f3;

  font-size: 10px;

}

.capability span {

  color: var(--orange);

  margin-right: 8px;

}

.side-note {

  background: #fff7f0;

  border-color: #ffe1ce;

}

.side-note b {

  font-size: 11px;

}

.toast {

  position: fixed;

  z-index: 60;

  bottom: 22px;

  left: 50%;

  transform: translate(-50%,20px);

  opacity: 0;

  background: #252832;

  color: white;

  padding: 10px 16px;

  border-radius: 9px;

  font-size: 11px;

  transition: .2s;

  pointer-events: none;

}

.toast.show {

  opacity: 1;

  transform: translate(-50%,0);

}

/* หน้าต่างรายละเอียดและพื้นหลังโปร่ง */
.modal-backdrop {

  position: fixed;

  z-index: 50;

  inset: 0;

  background: #20232b7a;

  backdrop-filter: blur(4px);

  display: grid;

  place-items: center;

  padding: 18px;

}

.modal {

  background: white;

  border-radius: 18px;

  width: min(100%,480px);

  padding: 24px;

  position: relative;

  box-shadow: 0 20px 70px #0002;

}

.close {

  position: absolute;

  right: 14px;

  top: 10px;

  border: 0;

  background: transparent;

  font-size: 24px;

  color: #888;

}

.modal h2 {

  font-size: 20px;

  margin: 11px 0 7px;

}

.modal p {

  font-size: 11px;

  line-height: 1.8;

  color: var(--muted);

}

.tags {

  display: flex;

  flex-wrap: wrap;

  gap: 7px;

  margin: 13px 0;

}

.tags span {

  font-size: 9px;

  background: #f2f3f7;

  color: #6c707a;

  padding: 6px 9px;

  border-radius: 20px;

}

.detail-info {

  background: #f8f9fb;

  padding: 12px;

  border-radius: 10px;

  margin: 14px 0;

  font-size: 10px;

  line-height: 1.8;

}

.profile-modal {

  text-align: center;

  width: min(100%,350px);

}

.profile-avatar-large {

  width: 68px;

  height: 68px;

  display: grid;

  place-items: center;

  margin: 0 auto 11px;

  background: #ffe1cd;

  color: #8e3510;

  border-radius: 50%;

  font-size: 27px;

  font-weight: 700;

}

.profile-data {

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 12px;

  text-align: left;

  border-block: 1px solid var(--line);

  padding: 16px 4px;

  margin: 16px 0;

  font-size: 10px;

}

.profile-data span {

  color: var(--muted);

}

.full {

  width: 100%;

}

.filter-page {

  max-width: 850px;

  margin: 0 auto;

}

/* รูปแบบแต่ละส่วนของแบบฟอร์มกรอง */
.filter-section {

  padding: 17px 0;

  border-bottom: 1px solid #f0f0f3;

}

.filter-section h3 {

  font-size: 12px;

  margin: 0 0 4px;

}

.filter-section p {

  font-size: 10px;

  color: var(--muted);

  margin: 0 0 11px;

}

.choice-list {

  display: flex;

  gap: 8px;

  flex-wrap: wrap;

}

.choice {

  background: white;

  border: 1px solid var(--line);

  border-radius: 20px;

  padding: 8px 12px;

  font-size: 10px;

  color: #686d78;

}

.choice input {

  accent-color: var(--orange);

  margin-right: 5px;

}

.choice:has(input:checked) {

  background: #fff2e8;

  border-color: #ffc9a7;

  color: var(--orange);

}

.filter-actions {

  display: flex;

  gap: 9px;

  justify-content: flex-end;

  margin-top: 20px;

}

.profile-page {

  max-width: 650px;

  margin: 0 auto;

}

/* บัตรโปรไฟล์และข้อมูลนักศึกษา */
.profile-card {

  background: white;

  border: 1px solid var(--line);

  border-radius: 18px;

  padding: 27px;

}

.profile-card-top {

  text-align: center;

  padding-bottom: 22px;

  border-bottom: 1px solid var(--line);

}

.profile-card .profile-avatar-large {

  width: 88px;

  height: 88px;

  font-size: 35px;

}

.profile-card-top h2 {

  font-size: 20px;

  margin: 8px 0 3px;

}

.profile-fields {

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 20px;

  padding: 22px 5px;

}

.profile-fields label {

  display: block;

  color: var(--muted);

  font-size: 10px;

  margin-bottom: 6px;

}

.profile-fields b {

  font-size: 12px;

}

/* ปรับเลย์เอาต์ให้เหมาะกับแท็บเล็ตและหน้าจอขนาดเล็ก */
@media(max-width:1050px) {

  .category-grid {

    grid-template-columns: repeat(2,minmax(0,1fr));

  }

  .benefit-grid {

    grid-template-columns: repeat(2,minmax(0,1fr));

  }

  .main-content {

    padding: 25px 22px;

  }

}

@media(max-width:800px) {

  .mobile-menu {

    display: block;

  }

  .sidebar {

    transform: translateX(-100%);

    transition: .22s;

  }

  .sidebar.open {

    transform: translateX(0);

    box-shadow: 12px 0 35px #20232b20;

  }

  .main-content {

    margin-left: 0;

    padding: 23px 18px;

  }

  .hero-art {

    right: 5%;

    opacity: .8;

  }

  .assistant-layout {

    grid-template-columns: 1fr;

  }

  .assistant-side {

    display: grid;

    grid-template-columns: 1fr 1fr;

  }

}

@media(max-width:560px) {

  .topbar {

    height: 60px;

    padding: 0 12px;

    gap: 9px;

  }

  .brand-mark {

    width: 35px;

    height: 35px;

    font-size: 20px;

  }

  .brand b {

    font-size: 11px;

  }

  .brand small {

    font-size: 8px;

  }

  .profile-name {

    display: none;

  }

  .sidebar {

    top: 60px;

  }

  .main-content {

    margin-top: 60px;

    padding: 19px 13px;

  }

  .welcome-row h1,.page-heading h1 {

    font-size: 23px;

  }

  .date-chip {

    display: none;

  }

  .hero {

    padding: 21px 18px;

    min-height: 260px;

  }

  .hero h2 {

    font-size: 25px;

  }

  .hero p {

    max-width: 220px;

  }

  .hero-art {

    right: -60px;

    opacity: .2;

  }

  .category-grid {

    gap: 8px;

  }

  .category-card {

    padding: 10px 8px;

    gap: 7px;

  }

  .category-icon {

    width: 32px;

    height: 32px;

    font-size: 17px;

  }

  .category-info b {

    font-size: 10px;

  }

  .category-info small {

    font-size: 8px;

  }

  .benefit-grid {

    grid-template-columns: 1fr;

    gap: 10px;

  }

  .section {

    margin-top: 26px;

  }

  .section-head h2 {

    font-size: 17px;

  }

  .page-heading {

    align-items: flex-start;

    gap: 8px;

  }

  .page-heading p {

    max-width: 245px;

  }

  .count {

    min-width: 62px;

    padding: 6px;

  }

  .count b {

    font-size: 17px;

  }

  .count small {

    font-size: 8px;

  }

  .toolbar {

    flex-wrap: wrap;

  }

  .toolbar .search {

    flex-basis: 100%;

  }

  .toolbar select {

    height: 38px;

    flex: 1;

  }

  .filter-chip {

    padding: 7px 9px;

  }

  .tip {

    flex-wrap: wrap;

    padding: 12px;

  }

  .tip>div:nth-child(2) {

    width: calc(100% - 55px);

    flex: auto;

  }

  .tip .button {

    margin-left: 50px;

  }

  .assistant-side {

    grid-template-columns: 1fr;

  }

  .chat-messages {

    padding: 12px;

    min-height: 270px;

  }

  .message {

    max-width: 96%;

  }

  .ai-label {

    display: none;

  }

  .notification-card {

    padding: 11px;

    gap: 9px;

  }

  .notification-card .benefit-icon {

    width: 34px;

    height: 34px;

  }

  .notification-copy h3 {

    font-size: 11px;

  }

  .notification-copy p {

    font-size: 9px;

  }

  .tabs {

    gap: 12px;

  }

  .profile-fields {

    grid-template-columns: 1fr 1fr;

    gap: 16px;

  }

}

.filter-modal {

  width: min(100%,650px);

  max-height: 88vh;

  overflow: auto;

  padding: 25px 26px;

}

.filter-modal h2 {

  margin: 5px 0;

}

.filter-modal>p {

  margin: 0 0 7px;

}

.filter-modal .filter-section {

  padding: 13px 0;

}

.filter-modal .filter-section h3 {

  margin-bottom: 9px;

}

.filter-modal .choice {

  font-size: 10px;

}

.filter-modal .filter-actions {

  position: sticky;

  bottom: -25px;

  background: white;

  padding: 13px 0 2px;

  margin-top: 10px;

}

.top-icon {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 34px;

  height: 34px;

  border-radius: 10px;

  color: #fff;

  transition: background 0.2s ease;

}

.top-icon:hover {

  background: #ffffff25;

}

.top-icon svg {

  display: block;

  width: 22px;

  height: 22px;

}

  /* รูปแบบตัวเลือกสาขาวิชาที่ขึ้นกับคณะที่เลือก */

.filter-section select.form-control {

  display: block;

  width: 100%;

  min-height: 44px;

  padding: 10px 12px;

  border: 1px solid var(--border,#d9dce5);

  border-radius: 10px;

  background: var(--surface,#fff);

  color: inherit;

  font: inherit;

  margin-top: 10px;

}

.filter-section select.form-control:disabled {

  background: #f1f3f7;

  color: #858b98;

  cursor: not-allowed;

}

  /* ขยายหน้าต่างรายละเอียดและปรับตัวอักษรให้อ่านง่ายขึ้น */

.modal-backdrop {

  padding: 24px;

  overflow-y: auto;

}

.modal {

  width: min(100%,760px);

  max-height: calc(100vh - 48px);

  overflow-y: auto;

  padding: 36px 40px;

  border-radius: 22px;

}

.modal h2 {

  font-size: 30px;

  line-height: 1.45;

  margin: 16px 0 12px;

  padding-right: 28px;

}

.modal p {

  font-size: 17px;

  line-height: 1.95;

  color: #555b67;

  margin: 10px 0;

}

.modal .category-label {

  font-size: 13px;

  margin-top: 12px;

}

.modal .benefit-icon {

  width: 54px;

  height: 54px;

  font-size: 27px;

  border-radius: 15px;

}

.modal .button {

  font-size: 16px;

  padding: 13px 19px;

  margin: 12px 8px 0 0;

}

.modal .close {

  font-size: 32px;

  right: 18px;

  top: 12px;

  padding: 4px 10px;

}

.modal .detail-info {

  font-size: 16px;

  line-height: 1.9;

  padding: 18px;

  border-radius: 13px;

}

@media(max-width:600px) {

  .modal-backdrop {

    padding: 12px;

  }

  .modal {

    width: 100%;

    max-height: calc(100vh - 24px);

    padding: 26px 22px;

    border-radius: 17px;

  }

  .modal h2 {

    font-size: 24px;

  }

  .modal p {

    font-size: 15px;

  }

  .modal .button {

    font-size: 14px;

  }

}

.modal .detail-section-title {

  font-size: 20px;

  line-height: 1.5;

  margin: 20px 0 6px;

  color: var(--ink);

}

.modal .benefit-description {

  white-space: pre-line;

  overflow-wrap: anywhere;

  margin-top: 0;

}

.modal .detail-info strong {

  font-size: 16px;

  display: block;

  margin-bottom: 4px;

}


.hero-slider {
  position: relative;
  isolation: isolate;
  margin-top: 23px;
  min-height: 300px;
  border-radius: 20px;
  overflow: hidden;
  color: #fff;
  background: #ff6d25;
  box-shadow: 0 14px 35px #f15a0a1c;
}

.hero-slides {
  position: relative;
  min-height: 300px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 32px 38px;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background-image:
    linear-gradient(
      90deg,
      rgb(45 27 20 / 82%) 0%,
      rgb(45 27 20 / 60%) 48%,
      rgb(45 27 20 / 15%) 100%
    ),
    var(--slide-image);
  background-size: cover;
  background-position: center;
  transition: opacity 0.45s ease;
}

.hero-slide.active {
  position: relative;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.hero-slide-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.hero-slide h2 {
  margin: 18px 0 10px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.45;
  color: #fff;
}

.hero-slide p {
  max-width: 460px;
  margin: 0 0 22px;
  color: #fff;
  font-size: 13px;
  line-height: 1.9;
}

.hero-slide .pill {
  display: inline-block;
}

.hero-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff70;
  border-radius: 50%;
  background: #ffffff25;
  color: #fff;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: #ffffff45;
}

.hero-prev {
  left: 14px;
}

.hero-next {
  right: 14px;
}

.hero-dots {
  position: absolute;
  z-index: 5;
  left: 38px;
  bottom: 18px;
  display: flex;
  gap: 8px;
}

.hero-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #ffffff80;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.active {
  width: 24px;
  background: #fff;
}

.hero-counter {
  position: absolute;
  z-index: 5;
  right: 22px;
  bottom: 17px;
  color: #ffffffc9;
  font: 500 11px Manrope, sans-serif;
}

.hero-counter b {
  color: #fff;
  font-size: 14px;
}

@media (max-width: 560px) {
  .hero-slider,
  .hero-slides {
    min-height: 310px;
  }

  .hero-slide {
    padding: 26px 24px 52px;
    background-position: center;
  }

  .hero-slide-content {
    max-width: 100%;
  }

  .hero-slide h2 {
    font-size: 24px;
  }

  .hero-slide p {
    max-width: 250px;
    font-size: 11px;
  }

  .hero-arrow {
    width: 32px;
    height: 32px;
    font-size: 23px;
  }

  .hero-prev {
    left: 8px;
  }

  .hero-next {
    right: 8px;
  }

  .hero-dots {
    left: 24px;
    bottom: 19px;
  }

  .hero-counter {
    right: 14px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-arrow,
  .hero-dots button {
    transition: none;
  }
}


.hero-slider-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 20px;
    background: transparent;
}

.hero-slides-image {
    position: relative;
    aspect-ratio: 16 / 5;
    min-height: 180px;
}

.hero-slide-image {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    background-image: var(--slide-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    transition: opacity 0.4s ease;
}

.hero-slide-image.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 600px) {
    .hero-slides-image {
        aspect-ratio: 4 / 3;
        min-height: 180px;
    }
}


.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #a51c30;
}


/* ========================================
   รูปแบบเพิ่มเติมสำหรับหน้าต่างรายละเอียดสิทธิประโยชน์
======================================== */

.modal[role="dialog"] {
    width: min(100%, 760px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 36px 40px;
    border-radius: 22px;
}

.modal[role="dialog"] h2 {
    font-size: 28px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.modal[role="dialog"] .benefit-description {
    white-space: pre-line;
    overflow-wrap: anywhere;
    margin-top: 0;
}

.modal[role="dialog"] .benefit-detail-list {
    margin: 0;
    padding-left: 24px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.modal[role="dialog"] .detail-section-title {
    font-size: 17px;
    line-height: 1.6;
    margin: 22px 0 8px;
    color: var(--ink);
}

.modal[role="dialog"] .detail-info {
    display: grid;
    grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.5fr);
    gap: 12px 16px;
    align-items: start;
    font-size: 13px;
    line-height: 1.8;
}

.modal[role="dialog"] .detail-info strong {
    font-size: 13px;
    display: block;
    margin: 0;
}

.modal[role="dialog"] .detail-info > div {
    overflow-wrap: anywhere;
}

.benefit-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.benefit-detail-actions .button {
    margin: 0;
    text-align: center;
}

@media (max-width: 600px) {
    .modal[role="dialog"] {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 26px 22px;
        border-radius: 17px;
    }

    .modal[role="dialog"] h2 {
        font-size: 23px;
    }

    .modal[role="dialog"] .detail-info {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .modal[role="dialog"] .detail-info > div {
        margin-bottom: 10px;
    }

    .benefit-detail-actions {
        flex-direction: column;
    }

    .benefit-detail-actions .button {
        width: 100%;
    }
}


/* ปรับตัวเลือกผู้ให้บริการให้ใช้รูปแบบเดียวกับตัวเลือกประเภท */
#providerFilters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#providerFilters label.choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 2px solid #e6e8ef;
    border-radius: 999px;
    background: #fff;
    color: #292b35;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s, border-color 0.2s;
}

#providerFilters label.choice input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--orange);
    cursor: pointer;
}

#providerFilters label.choice:has(input:checked) {
    background: #fff2e8;
    border-color: #ffc9a7;
    color: var(--orange);
}


/* ========================================
   ตัวกรองประเภทและผู้ให้บริการที่สร้างจากข้อมูล
======================================== */

#categoryFilters,
#providerFilters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#categoryFilters .choice,
#providerFilters .choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--line, #e6e8ef);
    border-radius: 999px;
    background: #fff;
    color: var(--ink, #292b35);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

#categoryFilters .choice input,
#providerFilters .choice input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--orange, #f47721);
    cursor: pointer;
}

#categoryFilters .choice:has(input:checked),
#providerFilters .choice:has(input:checked) {
    background: #fff2e8;
    border-color: #ffc9a7;
    color: var(--orange, #f47721);
}

#categoryFilters .choice:focus-within,
#providerFilters .choice:focus-within {
    outline: 2px solid #ffc9a7;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    #categoryFilters .choice,
    #providerFilters .choice {
        padding: 9px 13px;
        font-size: 12px;
    }
}

/* ให้ปุ่มผู้ให้บริการมีขนาดเท่ากับปุ่มประเภท */
#providerFilters label.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 2px solid #e6e8ef;
  border-radius: 999px;
  background: #fff;
  color: #292b35;
  cursor: pointer;
  font-size: 16px;
  font-weight: 400;
  transition: background 0.2s, border-color 0.2s;
}

#providerFilters label.choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--orange);
  cursor: pointer;
}

#providerFilters label.choice:has(input:checked) {
  background: #fff2e8;
  border-color: #ffc9a7;
  color: var(--orange);
}

/* ทำให้ปุ่มประเภทและผู้ให้บริการมีขนาดเท่ากัน */
#filterModal #providerFilters,
#filterModal .filter-section .choice-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* ใช้ขนาดปุ่มเดียวกันทั้งสองส่วน */
#filterModal #providerFilters .choice,
#filterModal .filter-section .choice-list .choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    padding: 12px 18px;
    border: 2px solid #e6e8ef;
    border-radius: 999px;
    background: #fff;
    color: #292b35;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

/* ใช้ขนาดช่องทำเครื่องหมายเท่ากัน */
#filterModal #providerFilters .choice input,
#filterModal .filter-section .choice-list .choice input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--orange);
    cursor: pointer;
}

/* เมื่อเลือก */
#filterModal #providerFilters .choice:has(input:checked),
#filterModal .filter-section .choice-list .choice:has(input:checked) {
    background: #fff2e8;
    border-color: #ffc9a7;
    color: var(--orange);
}

/* ปรับขนาดผู้ให้บริการให้เท่ากับปุ่มประเภท */
#filterModal #providerFilters .choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 2px solid #e6e8ef;
    border-radius: 999px;
    background: #fff;
    color: #292b35;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}

#filterModal #providerFilters .choice input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

/* ทำให้ปุ่มประเภท ชั้นปี และผู้ให้บริการมีขนาดเท่ากัน */
#filterModal .filter-section .choice-list .choice,
#filterModal #providerFilters .choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    padding: 8px 14px;
    border: 2px solid #e6e8ef;
    border-radius: 999px;
    background: #fff;
    color: #292b35;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
}

/* กำหนดขนาดช่องทำเครื่องหมายและปุ่มตัวเลือก */
#filterModal .filter-section .choice-list .choice input,
#filterModal #providerFilters .choice input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--orange);
    cursor: pointer;
}

/* สีเมื่อเลือก */
#filterModal .filter-section .choice-list .choice:has(input:checked),
#filterModal #providerFilters .choice:has(input:checked) {
    background: #fff2e8;
    border-color: #ffc9a7;
    color: var(--orange);
}


.benefit-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.benefit-card-name {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: #6b7280;
    overflow-wrap: anywhere;
}


.benefit-name-label {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}


.card-top {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.benefit-name-label {
    display: none;
}


/* การ์ดสิทธิประโยชน์ */
.benefit-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px 32px;
}

/* ส่วนหัว: ให้หัวใจอยู่ด้านขวาบน */
.card-top {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 8px;
}

/* ประเภททุน */
.category-label {
    margin-top: 0;
    margin-bottom: 8px;
}

/* ชื่อทุน */
.benefit-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

/* รายละเอียด */
.benefit-card p {
    margin-top: 0;
    margin-bottom: 20px;
}

/* วันหมดเขตและปุ่มดูรายละเอียด */
.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.save-button.saved {
    color: #e53935;
}

.save-button.saved:hover {
    color: #c62828;
}


/* สถานะปุ่มรายการโปรดทุกหน้า */
.save-button {
    color: #9a9da6;
    background: #fff;
    transition: color 0.2s ease, background 0.2s ease;
}

.save-button.saved,
.save-button.saved:focus {
    color: #e53935;
    background: #fff1e7;
    border-color: #ffd5bd;
}

.save-button.saved:hover {
    color: #c62828;
    background: #ffe5d8;
}

.logout-button {
  margin-top: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #dc2626;
  color: white;
  cursor: pointer;
}

.logout-button:hover {
  background: #b91c1c;
}