/* =====================================================================
   ระบบจัดซื้อหนังสือเรียน — ชุดออกแบบ (Design System) 2026
   ---------------------------------------------------------------------
   หลักคิด
     · Liquid Glass      : พื้นผิวโปร่งแสงซ้อนชั้น ให้ความรู้สึกมีมิติ
     · Bento Grid        : จัดบล็อกข้อมูลเป็นช่อง อ่านเร็ว ไม่ล้าตา
     · Micro-interaction : ทุกการกดมีการตอบสนอง สร้างความมั่นใจ
     · Adaptive          : สลับสว่าง/มืดได้ และจำค่าไว้
     · Green coding      : CSS ล้วน ไม่มีไลบรารีเพิ่ม โหลดไว
   ไฟล์นี้เขียนทับสไตล์ของ Bootstrap เท่านั้น ไม่แตะโครงสร้าง HTML ของหน้าใด
   ===================================================================== */

/* ---------------- โทเคนสี : โหมดสว่าง ---------------- */
:root {
  --brand-1: #1b3b6f;
  --brand-2: #2a5fa5;
  --brand-3: #4f8fd6;
  --accent:  #f0a341;

  --bg:        #eef2f7;
  --bg-soft:   #f7f9fc;
  --surface:   #ffffff;
  --surface-2: #f4f7fb;
  --glass:     rgba(255,255,255,.72);
  --glass-brd: rgba(255,255,255,.55);

  --text:      #16202e;
  --text-soft: #5b6b7f;
  --line:      #dde5ee;

  --ok:   #17845a;
  --warn: #b8791b;
  --bad:  #c33a3a;
  --info: #1c6ea4;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;

  --sh-1: 0 1px 2px rgba(16,32,54,.06), 0 2px 8px rgba(16,32,54,.05);
  --sh-2: 0 6px 18px rgba(16,32,54,.09);
  --sh-3: 0 14px 40px rgba(16,32,54,.16);

  --sidebar-w: 268px;
  --topbar-h:  62px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------------- โทเคนสี : โหมดมืด ---------------- */
[data-theme="dark"] {
  --brand-1: #0d1b2e;
  --brand-2: #16304f;
  --brand-3: #4f8fd6;

  --bg:        #0e1520;
  --bg-soft:   #131c2a;
  --surface:   #18222f;
  --surface-2: #1e2937;
  --glass:     rgba(30,41,55,.68);
  --glass-brd: rgba(255,255,255,.09);

  --text:      #e6edf5;
  --text-soft: #97a6b8;
  --line:      #2a3646;

  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 6px 18px rgba(0,0,0,.45);
  --sh-3: 0 14px 40px rgba(0,0,0,.55);
}

/* ---------------- พื้นฐาน ---------------- */
* { box-sizing: border-box; }

body {
  font-family: 'Sarabun','TH Sarabun New',-apple-system,'Segoe UI',sans-serif;
  font-size: 15.5px;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(79,143,214,.16), transparent 60%),
    radial-gradient(900px 520px at 105% 0%, rgba(240,163,65,.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  margin: 0;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand-3); }
[data-theme="dark"] a { color: var(--brand-3); }

::selection { background: rgba(79,143,214,.28); }

/* แถบเลื่อนบาง ๆ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); background-clip: content-box; }

/* =====================================================================
   โครงหน้าแบบมีแถบข้าง (ผู้ดูแลระบบ / เจ้าหน้าที่)
   ===================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(178deg, var(--brand-1) 0%, var(--brand-2) 78%, var(--brand-1) 100%);
  color: #dce8f7;
  box-shadow: var(--sh-2);
  z-index: 40;
  transition: width .28s var(--ease), flex-basis .28s var(--ease), transform .28s var(--ease);
}

.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 14px; color: #fff; font-weight: 700; letter-spacing: .2px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar .brand .mark {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.15rem;
  background: linear-gradient(140deg, rgba(255,255,255,.28), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(6px);
}
.sidebar .brand .txt { line-height: 1.15; }
.sidebar .brand .txt small { display: block; font-weight: 400; font-size: .72rem; opacity: .75; }

.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 10px 18px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); background-clip: content-box; }

.side-cap {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
  opacity: .58; padding: 14px 12px 6px; font-weight: 600;
}

.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 3px; border-radius: 10px;
  color: #cfe0f4; font-size: .95rem; position: relative;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.side-link i { width: 19px; text-align: center; font-size: 1.02rem; opacity: .92; }
.side-link:hover { background: rgba(255,255,255,.11); color: #fff; transform: translateX(2px); }
.side-link.active { background: rgba(255,255,255,.17); color: #fff; font-weight: 600; }
.side-link.active::before {
  content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.side-link.disabled { opacity: .38; cursor: not-allowed; }
.side-link .tag {
  margin-left: auto; font-size: .62rem; padding: 1px 7px; border-radius: 99px;
  background: rgba(255,255,255,.16);
}

/* กลุ่มเมนูย่อย */
.side-group > .side-link .chev { margin-left: auto; transition: transform .22s var(--ease); }
.side-group.open > .side-link .chev { transform: rotate(90deg); }
.side-sub { display: none; padding-left: 14px; margin: 2px 0 6px; border-left: 1px solid rgba(255,255,255,.14); }
.side-group.open .side-sub { display: block; animation: slideDown .22s var(--ease); }
.side-sub .side-link { padding: 7px 11px; font-size: .89rem; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.side-user {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12);
}
.side-user .av {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), #e07b39); color: #2a1a05; font-weight: 700;
}
.side-user .nm { line-height: 1.2; font-size: .87rem; color: #fff; }
.side-user .nm small { display: block; opacity: .7; font-size: .72rem; }

/* ย่อแถบข้าง */
.app-shell.collapsed .sidebar { width: 76px; flex-basis: 76px; }
/* .brand .txt มี inline style="display:flex" ในหน้า header.php อยู่ด้วย
   ต้องใช้ !important ไม่งั้น inline style จะชนะ CSS นี้ ทำให้ตัวหนังสือโลโก้
   ยังโผล่ทับกันตอนย่อแถบข้าง (เห็นเป็นตัวหนังสือซ้อนกันมั่วๆ ตรงมุมบนซ้าย) */
.app-shell.collapsed .sidebar .brand .txt { display: none !important; }
.app-shell.collapsed .side-cap,
.app-shell.collapsed .side-link span,
.app-shell.collapsed .side-link .chev,
.app-shell.collapsed .side-link .tag,
.app-shell.collapsed .side-user .nm { display: none; }
.app-shell.collapsed .side-link { justify-content: center; padding: 11px 0; }
.app-shell.collapsed .side-sub { display: none !important; }

/* ---------------- ส่วนเนื้อหา ---------------- */
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; flex: 1 1 auto; }
.topbar .page-title {
  font-weight: 700; font-size: 1.06rem; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .crumb {
  font-size: .78rem; color: var(--text-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-soft);
  display: grid; place-items: center; cursor: pointer;
  transition: all .16s var(--ease);
}
.icon-btn:hover { color: var(--brand-2); border-color: var(--brand-3); transform: translateY(-1px); box-shadow: var(--sh-1); }
.icon-btn:active { transform: translateY(0) scale(.94); }

.kbd {
  font-family: inherit; font-size: .72rem; padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-soft);
}

.content { flex: 1; padding: 22px 24px 40px; }

.app-footer {
  padding: 14px 24px 22px; text-align: center;
  color: var(--text-soft); font-size: .8rem; border-top: 1px solid var(--line);
}

/* =====================================================================
   โครงหน้าแบบแถบบน (ครูผู้สอน) — เรียบและปุ่มใหญ่
   ===================================================================== */
.topnav {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2));
  color: #fff; padding: 12px 20px; box-shadow: var(--sh-2);
  position: sticky; top: 0; z-index: 30;
}
.topnav a.nl {
  color: #d7e6f7; padding: 9px 15px; border-radius: 10px; font-size: 1rem;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .16s var(--ease);
}
.topnav a.nl:hover { background: rgba(255,255,255,.13); color: #fff; }
.topnav a.nl.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; }
.topnav .nl.disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- ตัวย่อเมนู (แถบบนของครูผู้สอน) บนจอเล็ก ---------------- */
.topnav-toggle {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.09); color: #fff;
  display: none; place-items: center; cursor: pointer; transition: background .16s var(--ease);
}
.topnav-toggle:hover { background: rgba(255,255,255,.18); }

.topnav-collapse { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; }
.topnav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.topnav-actions { margin-left: auto; flex: 0 0 auto; }

@media (max-width: 991.98px) {
  .topnav-toggle { display: grid; }
  .topnav-collapse {
    display: none; flex-direction: column; align-items: stretch; width: 100%;
    order: 3; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.16);
  }
  .app-shell.topnav-open .topnav-collapse { display: flex; animation: slideDown .2s var(--ease); }
  .topnav-links { flex-direction: column; align-items: stretch; gap: 2px; }
  .topnav a.nl, .topnav .nl.disabled { justify-content: flex-start; width: 100%; }
  .topnav-actions { margin-left: 0; justify-content: space-between; padding-top: 10px; }
}

/* =====================================================================
   เขียนทับส่วนประกอบของ Bootstrap
   ===================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.card:hover { box-shadow: var(--sh-2); }
.card-header {
  background: transparent; border-bottom: 1px solid var(--line);
  font-weight: 600; padding: 13px 18px; color: var(--text);
}
.card-body { padding: 18px; }

/* บล็อกแบบเบนโตะ */
.bento { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.bento > * { grid-column: span 12; }
@media (min-width: 768px)  { .bento .b-6 { grid-column: span 6; } .bento .b-4 { grid-column: span 6; } }
@media (min-width: 1200px) {
  .bento .b-3 { grid-column: span 3; } .bento .b-4 { grid-column: span 4; }
  .bento .b-6 { grid-column: span 6; } .bento .b-8 { grid-column: span 8; }
}

/* การ์ดกระจก */
.glass {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}

/* การ์ดสถิติเดิม (stat-card) ยังใช้ได้ แต่หน้าตาใหม่ */
.stat-card {
  border-radius: var(--r); padding: 18px 20px; color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--sh-2); transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat-card::after {
  content: ''; position: absolute; right: -26px; top: -26px; width: 110px; height: 110px;
  border-radius: 50%; background: rgba(255,255,255,.14);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.stat-card .n { font-size: 1.95rem; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.stat-card .t { opacity: .92; font-size: .88rem; }

/* ปุ่ม */
.btn {
  border-radius: 10px; font-weight: 500; padding: .48rem 1.05rem;
  transition: transform .14s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  border: 0; box-shadow: 0 3px 10px rgba(42,95,165,.3);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(42,95,165,.42); transform: translateY(-1px); }
.btn-lg-touch { font-size: 1.06rem; padding: .68rem 1.5rem; border-radius: 12px; }
.btn-light { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-light:hover { background: var(--line); color: var(--text); }

/* ตาราง */
.table { color: var(--text); border-color: var(--line); margin-bottom: 0; }
.table > :not(caption) > * > * { background-color: transparent; }
table.table-sys th, .table thead th {
  background: var(--surface-2); color: var(--text); font-weight: 600;
  border-bottom: 2px solid var(--line); white-space: nowrap;
}
.table tbody tr { transition: background .13s var(--ease); }
.table-hover tbody tr:hover > * { background: rgba(79,143,214,.09); }
.table td, .table th { border-color: var(--line); padding: .62rem .7rem; }

/* ฟอร์ม */
.form-control, .form-select {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: .52rem .8rem;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.form-control:focus, .form-select:focus {
  background: var(--surface); color: var(--text);
  border-color: var(--brand-3); box-shadow: 0 0 0 3.5px rgba(79,143,214,.18);
}
.form-control::placeholder { color: var(--text-soft); opacity: .7; }
.form-label { font-weight: 600; font-size: .9rem; color: var(--text); margin-bottom: .3rem; }
.form-text { color: var(--text-soft); }
.input-group-text { background: var(--surface-2); border-color: var(--line); color: var(--text-soft); }
.form-check-input { border-color: var(--line); background-color: var(--surface); }
.form-check-input:checked { background-color: var(--brand-2); border-color: var(--brand-2); }
.big-form label { font-size: 1rem; }
.big-form .form-control, .big-form .form-select { font-size: 1.03rem; padding: .6rem .85rem; }

/* กล่องข้อความ */
.alert { border: 0; border-left: 4px solid; border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.alert-success { background: rgba(23,132,90,.1);  border-color: var(--ok);   color: var(--ok); }
.alert-warning { background: rgba(184,121,27,.11); border-color: var(--warn); color: var(--warn); }
.alert-danger  { background: rgba(195,58,58,.1);  border-color: var(--bad);  color: var(--bad); }
.alert-info    { background: rgba(28,110,164,.1); border-color: var(--info); color: var(--info); }
.alert-secondary { background: var(--surface-2); border-color: var(--line); color: var(--text-soft); }
.alert-primary { background: rgba(42,95,165,.1); border-color: var(--brand-2); color: var(--brand-2); }

/* ป้าย */
.badge { font-weight: 600; border-radius: 99px; padding: .34em .72em; letter-spacing: .01em; }

/* อื่น ๆ */
.modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); }
.modal-header, .modal-footer { border-color: var(--line); }
.dropdown-menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2); padding: 6px; }
.dropdown-item { border-radius: 8px; color: var(--text); padding: .5rem .75rem; }
.dropdown-item:hover { background: var(--surface-2); color: var(--brand-2); }
.list-group-item { background: var(--surface); border-color: var(--line); color: var(--text); }
.list-group-item-action:hover { background: var(--surface-2); }
.nav-tabs { border-color: var(--line); }
.nav-tabs .nav-link { color: var(--text-soft); border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--brand-2); border-bottom-color: var(--line); }
.nav-tabs .nav-link.active { color: var(--brand-2); background: transparent; border-bottom-color: var(--brand-2); font-weight: 600; }
.accordion-item { background: var(--surface); border-color: var(--line); }
.accordion-button { background: var(--surface); color: var(--text); font-weight: 500; }
.accordion-button:not(.collapsed) { background: var(--surface-2); color: var(--brand-2); box-shadow: none; }
.accordion-button:focus { box-shadow: none; border-color: var(--line); }
hr { border-color: var(--line); opacity: 1; }
code { color: var(--brand-2); background: rgba(79,143,214,.1); padding: .1em .4em; border-radius: 5px; }
.text-muted { color: var(--text-soft) !important; }
.bg-light { background: var(--surface-2) !important; }
.bg-white { background: var(--surface) !important; }
.border { border-color: var(--line) !important; }
.table-light > * { background: var(--surface-2) !important; color: var(--text) !important; }

/* =====================================================================
   จานคำสั่งด่วน (กด Ctrl+K)
   ===================================================================== */
.palette-back {
  position: fixed; inset: 0; z-index: 1080; display: none;
  background: rgba(10,18,30,.45); backdrop-filter: blur(4px);
}
.palette-back.show { display: block; animation: fadeIn .14s var(--ease); }
.palette {
  max-width: 620px; margin: 11vh auto 0; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3);
  animation: popIn .18s var(--ease);
}
.palette input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 17px 20px;
  font-size: 1.04rem; font-family: inherit; background: transparent; color: var(--text); outline: none;
}
.palette .list { max-height: 56vh; overflow-y: auto; padding: 8px; }
.palette .it {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border-radius: 10px; cursor: pointer; color: var(--text);
}
.palette .it:hover, .palette .it.sel { background: var(--surface-2); color: var(--brand-2); }
.palette .it .g { margin-left: auto; font-size: .74rem; color: var(--text-soft); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn  { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ระลอกคลื่นตอนกดปุ่ม */
.ripple { position: relative; overflow: hidden; }
.ripple .rp {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,.55);
  transform: scale(0); animation: rip .55s linear; pointer-events: none;
}
@keyframes rip { to { transform: scale(3.2); opacity: 0; } }

/* ปรากฏตัวตอนโหลด */
.content > * { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------- จอเล็ก ---------------- */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(6,12,22,.5); z-index: 35;
  }
  .content { padding: 16px 14px 32px; }
}

/* ---------------- จอมือถือขนาดเล็ก ---------------- */
@media (max-width: 575.98px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .page-title { font-size: .96rem; }
  .icon-btn { width: 34px; height: 34px; }
  .content { padding: 14px 10px 28px; }
  .palette { margin: 8vh 10px 0; }
  .chat-fab { right: 14px; bottom: 14px; }
}

/* ---------------- สั่งพิมพ์ ---------------- */
@media print {
  .sidebar, .topbar, .app-footer, .no-print, .palette-back { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #999; }
}

/* =====================================================================
   คลาสเดิมที่หน้าต่าง ๆ เรียกใช้อยู่ — ต้องคงไว้เพื่อไม่ให้หน้าจอเพี้ยน
   ===================================================================== */
.badge-open   { background: var(--ok)  !important; color: #fff !important; }
.badge-closed { background: var(--text-soft) !important; color: #fff !important; }
.badge-draft  { background: var(--warn) !important; color: #fff !important; }

/* กล่องรับการลากวางในหน้าแผนการเรียน */
.plan-box {
  border-radius: var(--r-sm);
  transition: background .16s var(--ease), box-shadow .16s var(--ease);
}
.plan-box:empty::after {
  content: 'ลากรายวิชามาวางที่นี่';
  display: block; text-align: center; color: var(--text-soft);
  padding: 22px 10px; font-size: .9rem;
  border: 1.5px dashed var(--line); border-radius: var(--r-sm); margin: 6px;
}
/* นำกรอบและพื้นหลังด้านหลังโลโก้ออกทั้งหมด */
.brand .mark {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;             /* ปลดความกว้างตายตัว */
    height: auto !important;            /* ปลดความสูงตายตัว */
    background: transparent !important; /* ลบสีพื้นหลังกรอบสี่เหลี่ยม */
    border: none !important;            /* ลบเส้นขอบ */
    box-shadow: none !important;        /* ลบเงากรอบเดิม */
    border-radius: 0 !important;
    padding: 0 !important;
    margin-right: 10px !important;      /* เว้นระยะห่างจากชื่อวิทยาลัยเล็กน้อย */
    flex-shrink: 0;
}

.brand .mark .app-logo {
    width: 44px !important;             /* ขนาดตราโลโก้ (ปรับเพิ่ม/ลดได้ตามต้องการ) */
    height: 44px !important;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); /* เงาบางๆ ให้ตราสัญลักษณ์ดูลอยคมชัด */
}
.plan-box .list-group-item { border-radius: 8px; margin: 3px 6px; border: 1px solid var(--line); }
.plan-box .list-group-item:hover { border-color: var(--brand-3); background: var(--surface-2); }