/* =====================================================================
   Graduate Employment & Alumni Tracking System — Theme
   โทนสี: ส้ม #FF671A (สีหลัก) – เขียว #BBDC12 (สีรอง) / ขาว / ม่วงอ่อน / เทาอ่อน  •  รองรับ Light / Dark mode
   สีหลักและสีรองปรับได้ที่ ตั้งค่าระบบ › ข้อมูลทั่วไป
   ===================================================================== */
:root {
  --brand: #FF671A;            /* ส้ม (ปรับได้จากหน้าตั้งค่า) */
  --brand-rgb: 255, 103, 26;
  --brand-dark: #CC4813;
  --brand-light: #C4B5FD;
  --accent: #BBDC12;           /* เขียว (สีรอง) */
  --accent-rgb: 187, 220, 18;
  --accent-dark: #67790A;      /* เขียวเข้มขึ้น ใช้กับตัวอักษรไล่เฉดให้อ่านง่าย */
  /* ไล่เฉดให้ม่วงเข้มเป็นส่วนใหญ่ เพื่อให้ตัวอักษรสีขาวบนปุ่ม/หัวฟอร์มยังอ่านชัด */
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand) 40%, var(--accent) 140%);
  --grad-text: linear-gradient(90deg, var(--brand), var(--accent-dark), var(--brand));
  --brand-soft: #F1EBFE;       /* ม่วงอ่อน */
  --brand-soft-2: #F8F5FF;
  --accent-soft: #E7F8F1;
  --gray-soft: #F4F5F7;        /* เทาอ่อน */
  --surface: #FFFFFF;
  --text: #2B2F36;
  --muted: #6B7280;
  --border: #ECEDF0;
  --shadow: 0 6px 24px rgba(30, 20, 40, .06);
  --shadow-lg: 0 14px 40px rgba(var(--brand-rgb), .18);
  --radius: 16px;
  --sidebar-w: 264px;
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand-dark);
  --bs-link-color-rgb: 59, 15, 128;
  --bs-link-hover-color: var(--brand);
  --bs-body-font-family: 'Prompt', system-ui, sans-serif;
  --bs-body-bg: var(--gray-soft);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-focus-ring-color: rgba(var(--brand-rgb), .25);
}
[data-bs-theme="dark"] {
  --accent-dark: var(--accent);
  --grad-text: linear-gradient(90deg, var(--brand-light), var(--accent), var(--brand-light));
  --brand-soft: rgba(var(--brand-rgb), .14);
  --brand-soft-2: rgba(var(--brand-rgb), .07);
  --gray-soft: #15171C;
  --surface: #1E2128;
  --text: #E6E7EA;
  --muted: #9CA3AF;
  --border: #2D313A;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --bs-body-bg: var(--gray-soft);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-link-color: var(--brand-light);
  --bs-link-color-rgb: 196, 181, 253;
  --accent-soft: rgba(var(--accent-rgb), .14);
  --bs-secondary-bg: #262A32;
  --bs-tertiary-bg: #20242B;
}

html { scroll-behavior: smooth; }
body { font-family: var(--bs-body-font-family); font-weight: 400; background: var(--gray-soft); color: var(--text); -webkit-font-smoothing: antialiased; }
.font-body, p, td, th, .form-control, .form-select, textarea, button, .btn, input, select { font-family: 'Prompt', system-ui, sans-serif; }
p, td, .form-control, .form-select { font-size: 1.02rem; }
h1, h2, h3, h4, h5, h6, .fw-display { font-family: 'Prompt', sans-serif; font-weight: 600; }
::selection { background: rgba(var(--brand-rgb), .25); }
a { text-decoration: none; }

/* ---------- Bootstrap overrides ---------- */
.btn { border-radius: 12px; font-weight: 500; padding: .55rem 1.1rem; transition: transform .15s ease, box-shadow .2s ease, background-color .2s; }
.btn:active { transform: scale(.98); }
.btn-sm { border-radius: 10px; padding: .35rem .75rem; }
.btn-lg { border-radius: 14px; padding: .8rem 1.5rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(var(--brand-rgb), .35); transform: translateY(-1px); }
.btn-outline-primary { --bs-btn-color: var(--brand-dark); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--brand-light); }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); border: 0; }
.btn-soft:hover { background: var(--brand); color: #fff; }
[data-bs-theme="dark"] .btn-soft { color: var(--brand-light); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }
.border-primary { border-color: var(--brand) !important; }
.form-control, .form-select { border-radius: 12px; padding: .6rem .9rem; border-color: var(--border); background-color: var(--surface); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--brand-rgb), .6); box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; font-size: .94rem; margin-bottom: .35rem; }
.form-label .req { color: #dc3545; }
.input-group-text { border-radius: 12px; background: var(--brand-soft-2); border-color: var(--border); }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card-soft { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .75rem .8rem; border-color: var(--border); }
.table thead th { font-family: 'Prompt'; font-weight: 500; font-size: .86rem; color: var(--muted); text-transform: none; background: var(--brand-soft-2); white-space: nowrap; }
.table-hover tbody tr { transition: background-color .15s; }
.table-hover tbody tr:hover > * { background: var(--brand-soft-2); }
.modal-content { border-radius: 20px; border: 0; background: var(--surface); }
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.dropdown-menu { border-radius: 14px; border-color: var(--border); box-shadow: var(--shadow); padding: .4rem; }
.dropdown-item { border-radius: 10px; padding: .5rem .8rem; }
.dropdown-item:active { background: var(--brand); }
.badge { font-weight: 500; }
.nav-pills .nav-link.active { background: var(--brand); }
.nav-pills .nav-link { color: var(--text); border-radius: 12px; }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--brand-dark); --bs-pagination-border-radius: 10px; }
.progress { --bs-progress-bar-bg: var(--brand); border-radius: 50px; background: var(--brand-soft); }
.alert { border-radius: 14px; }
.text-muted { color: var(--muted) !important; }
.swal2-popup { border-radius: 20px !important; font-family: 'Prompt', sans-serif !important; }
.swal2-confirm { background: var(--brand) !important; border-radius: 12px !important; }
.swal2-cancel, .swal2-deny { border-radius: 12px !important; }
[data-bs-theme="dark"] .swal2-popup { background: var(--surface); color: var(--text); }

/* ---------- Page loader ---------- */
#page-loader { position: fixed; inset: 0; z-index: 3000; background: var(--surface); display: flex; align-items: center; justify-content: center; transition: opacity .35s ease, visibility .35s; }
#page-loader.hide { opacity: 0; visibility: hidden; }
.loader-ring { width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ajax-loading { position: relative; pointer-events: none; }
.ajax-loading::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, .55); border-radius: inherit; }
[data-bs-theme="dark"] .ajax-loading::after { background: rgba(0, 0, 0, .35); }
.ajax-loading::before { content: ''; position: absolute; z-index: 2; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }

/* ---------- Animations ---------- */
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.fade-up.in { opacity: 1; transform: none; }
.hover-lift { transition: transform .2s ease, box-shadow .2s ease; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* =====================================================================
   PUBLIC SITE
   ===================================================================== */
.public-nav { background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
[data-bs-theme="dark"] .public-nav { background: rgba(30, 33, 40, .85); }
.public-nav .navbar-brand { display: flex; align-items: center; gap: .65rem; font-weight: 600; line-height: 1.15; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-title { font-size: .98rem; color: var(--text); }
.brand-sub { font-size: .74rem; color: var(--muted); font-weight: 400; }
.public-nav .nav-link { font-weight: 500; color: var(--text); border-radius: 10px; padding: .45rem .85rem !important; }
.public-nav .nav-link:hover, .public-nav .nav-link.active { color: var(--brand); background: var(--brand-soft-2); }

.hero { position: relative; overflow: hidden; padding: 4.5rem 0 5.5rem; background:
  radial-gradient(1100px 500px at 90% -10%, rgba(var(--brand-rgb), .28), transparent 60%),
  radial-gradient(800px 400px at -10% 110%, rgba(var(--brand-rgb), .18), transparent 60%),
  linear-gradient(180deg, var(--brand-soft-2), var(--gray-soft)); }
.hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); line-height: 1.3; font-weight: 700; }
.hero .lead { color: var(--muted); font-size: 1.12rem; }
.hero-badge { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .9rem; border-radius: 50px; background: var(--surface); box-shadow: var(--shadow); font-size: .88rem; color: var(--brand-dark); font-weight: 500; }
[data-bs-theme="dark"] .hero-badge { color: var(--brand-light); }
.hero-art { position: relative; border-radius: 28px; padding: 1.6rem; background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); overflow: hidden; }
.hero-art::before, .hero-art::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero-art::before { width: 260px; height: 260px; top: -90px; right: -80px; }
.hero-art::after { width: 180px; height: 180px; bottom: -70px; left: -50px; }
.hero-art .mini { position: relative; z-index: 1; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); border-radius: 18px; padding: 1rem 1.1rem; backdrop-filter: blur(6px); }
.hero-art .mini .v { font-size: 1.8rem; font-weight: 700; }
.hero-art .bars { display: flex; align-items: flex-end; gap: 10px; height: 110px; }
.hero-art .bars span { flex: 1; background: rgba(255, 255, 255, .85); border-radius: 8px 8px 4px 4px; animation: grow 1.2s ease both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }
.hero-banner-img { border-radius: 28px; width: 100%; object-fit: cover; max-height: 380px; box-shadow: var(--shadow-lg); }

.stat-card { border-radius: 20px; padding: 1.4rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); height: 100%; position: relative; overflow: hidden; }
.stat-card .icon { width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.45rem; background: var(--brand-soft); color: var(--brand); }
.stat-card .value { font-size: 2rem; font-weight: 700; font-family: 'Prompt'; line-height: 1.1; margin-top: .8rem; }
.stat-card .label { color: var(--muted); font-size: .92rem; }
.stat-card::after { content: ''; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--brand-soft-2); }
.section-title { font-weight: 700; position: relative; padding-bottom: .6rem; margin-bottom: 1.6rem; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 52px; height: 4px; border-radius: 4px; background: var(--brand); }
.text-center .section-title::after, .section-title.text-center::after { left: 50%; transform: translateX(-50%); }
.action-card { border-radius: 22px; padding: 1.8rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: block; color: var(--text); height: 100%; }
.action-card .icon { width: 60px; height: 60px; border-radius: 18px; background: var(--grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; margin-bottom: 1rem; }
.action-card:hover { color: var(--text); }
.action-card .go { color: var(--brand); font-weight: 500; }
.news-card { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); height: 100%; display: flex; flex-direction: column; }
.news-card .thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand-soft), var(--brand-soft-2)); display: flex; align-items: center; justify-content: center; color: var(--brand); font-size: 2.6rem; overflow: hidden; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.news-card:hover .thumb img { transform: scale(1.05); }
.news-card .date { font-size: .82rem; color: var(--muted); }
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-top: 4rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }

/* ---------- Registration wizard ---------- */
.wizard-head { background: var(--grad); color: #fff; border-radius: 24px 24px 0 0; padding: 1.6rem 1.8rem; }
.wizard-body { background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 24px 24px; padding: 1.8rem; box-shadow: var(--shadow); }
.wizard-progress { height: 10px; background: rgba(255, 255, 255, .3); }
.wizard-progress .progress-bar { background: #fff; transition: width .45s ease; }
.steps { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.step-pill { flex: 1 0 auto; display: flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 50px; background: rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .85); font-size: .85rem; white-space: nowrap; cursor: pointer; border: 0; transition: background .2s; }
.step-pill .n { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .25); font-weight: 600; font-size: .8rem; }
.step-pill.active { background: #fff; color: var(--brand-dark); font-weight: 600; }
.step-pill.active .n { background: var(--brand); color: #fff; }
.step-pill.done .n { background: #fff; color: var(--brand); }
.wizard-step { display: none; animation: stepIn .35s ease; }
.wizard-step.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.step-title { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.4rem; }
.step-title .i { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.sub-panel { border: 1px dashed rgba(var(--brand-rgb), .45); background: var(--brand-soft-2); border-radius: 18px; padding: 1.3rem; margin-top: 1rem; animation: stepIn .3s ease; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.status-option input { display: none; }
.status-option label { display: flex; align-items: center; gap: .6rem; border: 1.5px solid var(--border); border-radius: 14px; padding: .8rem 1rem; cursor: pointer; transition: all .15s; height: 100%; background: var(--surface); }
.status-option label i { font-size: 1.25rem; color: var(--brand); }
.status-option label:hover { border-color: rgba(var(--brand-rgb), .6); }
.status-option input:checked + label { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); font-weight: 500; }
.rating-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.rating-row:last-child { border-bottom: 0; }
.rating { display: inline-flex; gap: .35rem; }
.rating input { display: none; }
.rating label { width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 600; transition: all .15s; background: var(--surface); }
.rating label:hover { border-color: var(--brand); color: var(--brand); }
.rating input:checked + label { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.06); }
.rating-legend { font-size: .82rem; color: var(--muted); }
.policy-box { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.2rem; background: var(--brand-soft-2); font-size: .95rem; }
.policy-box h6 { margin-top: .8rem; }
.consent-box { border: 1.5px solid var(--brand); border-radius: 14px; padding: 1rem 1.2rem; background: var(--brand-soft); }
.review-table th { width: 38%; color: var(--muted); font-weight: 500; font-family: 'Prompt'; font-size: .9rem; }
.review-section { font-weight: 600; color: var(--brand-dark); background: var(--brand-soft-2) !important; }
[data-bs-theme="dark"] .review-section { color: var(--brand-light); }
.ref-code { font-family: 'Prompt'; font-size: 2rem; letter-spacing: .12em; font-weight: 700; color: var(--brand-dark); background: var(--brand-soft); padding: .6rem 1.4rem; border-radius: 16px; display: inline-block; border: 2px dashed rgba(var(--brand-rgb), .5); }
[data-bs-theme="dark"] .ref-code { color: var(--brand-light); }
.success-check { width: 92px; height: 92px; border-radius: 50%; background: linear-gradient(135deg, #34c38f, #1f9d6f); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 3rem; box-shadow: 0 14px 36px rgba(31, 157, 111, .35); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.invalid-feedback { font-size: .85rem; }

/* =====================================================================
   ADMIN
   ===================================================================== */
.admin-body { min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); z-index: 1040; display: flex; flex-direction: column; transition: transform .25s ease; }
.sidebar .brand { padding: 1.2rem 1.2rem 1rem; display: flex; align-items: center; gap: .7rem; border-bottom: 1px solid var(--border); }
.sidebar .brand .t { font-weight: 600; font-size: .92rem; line-height: 1.25; color: var(--text); }
.sidebar .brand .s { font-size: .72rem; color: var(--muted); }
.sidebar nav { padding: .8rem; overflow-y: auto; flex: 1; }
.sidebar .menu-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .9rem .8rem .35rem; }
.sidebar .menu-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .85rem; border-radius: 12px; color: var(--text); font-weight: 400; font-size: .95rem; margin-bottom: 2px; transition: background .15s, color .15s, transform .15s; }
.sidebar .menu-link i { font-size: 1.1rem; width: 22px; text-align: center; color: var(--muted); transition: color .15s; }
.sidebar .menu-link:hover { background: var(--brand-soft-2); color: var(--brand); transform: translateX(2px); }
.sidebar .menu-link:hover i { color: var(--brand); }
.sidebar .menu-link.active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(var(--brand-rgb), .3); font-weight: 500; }
.sidebar .menu-link.active i { color: #fff; }
.sidebar .menu-link .badge { margin-left: auto; }
.sidebar .side-foot { padding: 1rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.admin-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: .7rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
[data-bs-theme="dark"] .topbar { background: rgba(30, 33, 40, .85); }
.topbar .page-h { font-weight: 600; font-size: 1.12rem; margin: 0; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.admin-content { padding: 1.6rem; flex: 1; }
.admin-footer { padding: 1rem 1.6rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); background: var(--surface); }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .admin-main { margin-left: 0; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1035; }
  .admin-content { padding: 1rem; }
}
.kpi { border-radius: 18px; padding: 1.15rem 1.2rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); height: 100%; display: flex; gap: .9rem; align-items: center; }
.kpi .ic { width: 50px; height: 50px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.kpi .v { font-family: 'Prompt'; font-weight: 700; font-size: 1.55rem; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: .84rem; }
.kpi .sub { font-size: .76rem; color: var(--muted); }
.ic-pink { background: var(--brand-soft); color: var(--brand); }
.ic-green { background: var(--accent-soft); color: var(--accent-dark); }
.ic-blue { background: rgba(80, 140, 255, .14); color: #3b6fd8; }
.ic-amber { background: rgba(245, 170, 60, .16); color: #c27a07; }
.ic-violet { background: rgba(150, 100, 240, .14); color: #7b4fd6; }
.ic-gray { background: rgba(120, 130, 150, .14); color: #5f6b7c; }
.ic-red { background: rgba(240, 80, 80, .13); color: #d03d3d; }
.chart-card { border-radius: 18px; padding: 1.2rem 1.3rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); height: 100%; }
.chart-card h6 { font-weight: 600; margin-bottom: .2rem; }
.chart-card .hint { font-size: .8rem; color: var(--muted); margin-bottom: .8rem; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; }
.filter-bar { border-radius: 18px; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.dt-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.dt-info { color: var(--muted); font-size: .88rem; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: '\F282'; font-family: 'bootstrap-icons'; font-size: .7rem; margin-left: .35rem; opacity: .35; }
th.sortable.asc::after { content: '\F286'; opacity: 1; color: var(--brand); }
th.sortable.desc::after { content: '\F282'; opacity: 1; color: var(--brand); }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.empty-state i { font-size: 2.6rem; color: var(--brand); opacity: .6; }
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ''; position: absolute; left: .45rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.1rem; }
.timeline-item::before { content: ''; position: absolute; left: -1.38rem; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.dl-grid { display: grid; grid-template-columns: 170px 1fr; gap: .45rem 1rem; }
.dl-grid dt { color: var(--muted); font-weight: 400; font-size: .9rem; }
.dl-grid dd { margin: 0; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; } .dl-grid dt { margin-top: .4rem; } }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--grad); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::before { content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%; background: rgba(255, 255, 255, .08); right: -160px; top: -120px; }
.login-art::after { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .07); left: -100px; bottom: -100px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--surface); }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }
.theme-toggle { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }
.color-swatch { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--border); cursor: pointer; }

@media print {
  .no-print, .sidebar, .topbar, .public-nav, .site-footer, #page-loader, .admin-footer { display: none !important; }
  .admin-main { margin: 0 !important; }
  body { background: #fff !important; }
  .card-soft, .wizard-body { box-shadow: none !important; border: 0 !important; }
}
.status-option input.is-invalid + label, .rating input.is-invalid + label { border-color: #dc3545; }
.status-option input.is-invalid ~ .invalid-feedback { display: block; }
.was-validated .form-control:valid, .was-validated .form-select:valid { border-color: var(--border); background-image: none; padding-right: .9rem; }
.news-content p { line-height: 1.85; }
#reportList .menu-link { transition: background .15s; }
#reportList .menu-link:hover { background: var(--brand-soft-2); }
#reportList .menu-link.active { background: var(--brand-soft); color: var(--brand-dark) !important; font-weight: 500; }
[data-bs-theme="dark"] #reportList .menu-link.active { color: var(--brand-light) !important; }
.public-nav .nav-link { white-space: nowrap; }
#alumniTable td { font-size: .92rem; }
#reportBox th { white-space: normal; min-width: 90px; vertical-align: bottom; }
#reportBox td:first-child, #reportBox th:first-child { min-width: 230px; }
@media (max-width: 575.98px) { .public-nav .brand-sub { display: none !important; } .public-nav .navbar-brand { max-width: 62%; } .brand-mark { width: 38px; height: 38px; } }
.public-nav .btn { white-space: nowrap; }
@media (max-width: 1599.98px) { .public-nav .brand-sub { display: none !important; } }
.public-nav .btn-outline-secondary { --bs-btn-color: var(--muted); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-color: var(--brand-dark); --bs-btn-hover-border-color: var(--brand); }

/* =====================================================================
   v1.3 — ธีมม่วง-เขียว + โลโก้ + อนิเมชัน
   (ปิดอนิเมชันอัตโนมัติเมื่อผู้ใช้ตั้งค่าระบบปฏิบัติการให้ลดการเคลื่อนไหว)
   ===================================================================== */
/* ---------- โลโก้ ---------- */
.brand-mark { background: var(--grad); background-size: 200% 200%; box-shadow: 0 6px 16px rgba(var(--brand-rgb), .28); }
.brand-mark.has-logo { background: #fff; padding: 3px; border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(var(--brand-rgb), .15); }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; background: transparent; }
.brand-mark-lg { width: 76px; height: 76px; font-size: 2.2rem; border-radius: 20px; }
.login-art .brand-mark:not(.has-logo) { background: rgba(255, 255, 255, .18); box-shadow: none; }
.topbar-logo { width: 34px; height: 34px; border-radius: 10px; font-size: 1.05rem; }

/* ---------- Loader: วงแหวนไล่เฉดหมุนรอบโลโก้ ---------- */
.loader-box { position: relative; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
.loader-box .loader-ring { position: absolute; inset: 0; width: auto; height: auto; border: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 25%, var(--accent), var(--brand)); animation: spin 1s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.loader-logo { width: 54px; height: 54px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.6rem; background: var(--grad); animation: pulse 1.4s ease-in-out infinite; overflow: hidden; }
.loader-logo.has-logo { background: #fff; padding: 4px; }
.loader-logo img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- ปุ่มและองค์ประกอบไล่เฉดสี ---------- */
.btn-primary { background-image: var(--grad); background-size: 200% 100%; background-position: 0 0; border: 0; position: relative; overflow: hidden; transition: background-position .5s ease, transform .15s ease, box-shadow .2s ease; }
.btn-primary:hover, .btn-primary:focus-visible { background-position: 30% 0; box-shadow: 0 10px 24px rgba(var(--accent-rgb), .35); }
.btn-primary::after { content: ''; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); }
.btn-primary:hover::after { animation: shine .8s ease; }
.btn-soft { background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft)); }
.progress-bar, .wizard-progress .progress-bar { background-image: linear-gradient(90deg, var(--brand), var(--accent)); }
.wizard-progress .progress-bar { background: #fff; }
.section-title::after { background: var(--grad); width: 64px; }
.stat-card .icon, .step-title .i { background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft)); }
.stat-card .value { background: var(--grad-text); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; }
.status-option input:checked + label, .rating input:checked + label { border-color: var(--brand); }
.rating input:checked + label { background: var(--grad); border-color: transparent; }
.success-check { background: var(--grad); box-shadow: 0 14px 36px rgba(var(--accent-rgb), .35); }
.hero h1 .grad-text, .grad-text { background: var(--grad-text); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; }
.public-nav, .topbar { border-bottom: 0; }
.public-nav::after, .topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--brand), var(--accent), var(--brand)); background-size: 200% 100%; opacity: .85; }
.topbar { position: sticky; }
.sidebar .menu-link.active { box-shadow: 0 8px 18px rgba(var(--brand-rgb), .28); }
.sidebar .menu-link:hover i { transform: scale(1.15); }
.sidebar .menu-link i { transition: transform .2s ease, color .15s; }
.ic-pink { background: var(--brand-soft); color: var(--brand); }
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); opacity: 0; transition: opacity .25s; }
.kpi:hover::before { opacity: 1; }
.chart-card { transition: transform .25s ease, box-shadow .25s ease; }
.chart-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(var(--brand-rgb), .12); }
.action-card .icon { transition: transform .35s cubic-bezier(.2, 1.6, .4, 1); }
.action-card:hover .icon { transform: translateY(-4px) rotate(-6deg) scale(1.06); }
.news-card .thumb { background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft)); }
.hero { background:
  radial-gradient(900px 480px at 92% -10%, rgba(var(--brand-rgb), .22), transparent 60%),
  radial-gradient(800px 420px at -10% 110%, rgba(var(--accent-rgb), .20), transparent 60%),
  linear-gradient(180deg, var(--brand-soft-2), var(--gray-soft)); }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; pointer-events: none; z-index: 0; }
.hero::before { width: 320px; height: 320px; background: rgba(var(--brand-rgb), .55); top: -80px; left: 35%; }
.hero::after { width: 280px; height: 280px; background: rgba(var(--accent-rgb), .5); bottom: -100px; right: 10%; }
.hero > .container { position: relative; z-index: 1; }
.hero-art { background: var(--grad); background-size: 200% 200%; }
.login-art { background: var(--grad); background-size: 200% 200%; }
.wizard-head { background: var(--grad); background-size: 200% 200%; }

/* ---------- Keyframes ---------- */
@keyframes gradShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes blob { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, -30px) scale(1.1); } 66% { transform: translate(-30px, 20px) scale(.92); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.9); } }
@keyframes shine { to { left: 125%; } }
@keyframes fadeUpIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  body { animation: pageIn .4s ease both; }
  .brand-mark:not(.has-logo), .hero-art, .login-art, .wizard-head, .sidebar .menu-link.active { animation: gradShift 9s ease infinite; background-size: 200% 200%; }
  .public-nav::after, .topbar::after, .grad-text { animation: gradShift 6s linear infinite; }
  .hero::before { animation: blob 16s ease-in-out infinite; }
  .hero::after { animation: blob 20s ease-in-out infinite reverse; }
  .hero-art, .float-y { animation-name: gradShift, floatY; animation-duration: 9s, 6s; animation-iteration-count: infinite; animation-timing-function: ease, ease-in-out; }
  .anim-in { opacity: 0; animation: fadeUpIn .55s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }
  .sidebar nav .menu-link { animation: slideIn .4s ease both; animation-delay: calc(var(--i, 0) * 35ms); }
  .stat-card .icon, .kpi .ic { transition: transform .3s ease; }
  .stat-card:hover .icon, .kpi:hover .ic { transform: rotate(-8deg) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .fade-up { opacity: 1; transform: none; }
}
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: #262A32; --bs-btn-color: var(--text); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: #2F3440; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--border); --bs-btn-active-bg: #2F3440; --bs-btn-active-color: #fff; }
/* ---------- รูปถ่ายนักศึกษา ---------- */
.photo-field { display: flex; gap: 1.1rem; align-items: center; padding: 1rem; border: 1px dashed rgba(var(--brand-rgb), .35); border-radius: 18px; background: linear-gradient(135deg, var(--brand-soft-2), var(--accent-soft)); }
.photo-preview { position: relative; width: 104px; height: 128px; flex-shrink: 0; border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--surface); border: 2px solid var(--surface); box-shadow: 0 6px 18px rgba(var(--brand-rgb), .18); transition: transform .2s ease; }
.photo-preview:hover { transform: scale(1.03); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; color: var(--brand); opacity: .55; }
.photo-preview .cam { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .85rem; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }
.photo-field:has(.is-invalid) { border-color: #dc3545; }
.avatar-photo { object-fit: cover; padding: 0 !important; }
.list-avatar { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--brand-soft); }
@media (max-width: 575.98px) { .photo-field { flex-direction: column; text-align: center; } }
[data-bs-theme="dark"] .text-primary { color: var(--brand-light) !important; }
[data-bs-theme="dark"] .ic-pink, [data-bs-theme="dark"] .stat-card .icon { color: var(--brand-light); }

/* ---------- v1.5: โหมดมืดกับสีม่วงเข้มมาก (#290044) ใช้ม่วงสว่างแทนในตัวอักษร/พื้นอ่อน ---------- */
[data-bs-theme="dark"] {
  --brand-soft: color-mix(in srgb, var(--brand-light) 16%, transparent);
  --brand-soft-2: color-mix(in srgb, var(--brand-light) 8%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
}
[data-bs-theme="dark"] .public-nav .nav-link:hover, [data-bs-theme="dark"] .public-nav .nav-link.active,
[data-bs-theme="dark"] .sidebar .menu-link:hover, [data-bs-theme="dark"] .sidebar .menu-link:hover i,
[data-bs-theme="dark"] .action-card .go, [data-bs-theme="dark"] .stat-card .icon, [data-bs-theme="dark"] .step-title .i,
[data-bs-theme="dark"] .photo-preview .ph { color: var(--brand-light); }
[data-bs-theme="dark"] .btn-primary { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--brand-light); --bs-btn-border-color: var(--brand-light); }
.text-accent { color: var(--accent-dark) !important; }

/* ---------- Pop up เข้าสู่ระบบ ---------- */
.login-modal .modal-content { overflow: hidden; border-radius: 24px; }
.login-modal .lm-head { background: var(--grad); background-size: 200% 200%; color: #fff; padding: 1.6rem 1.6rem 1.2rem; position: relative; overflow: hidden; }
.login-modal .lm-head::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -50px; top: -70px; background: rgba(var(--accent-rgb), .45); filter: blur(10px); }
.login-modal .lm-head .btn-close { position: absolute; top: 1rem; right: 1rem; z-index: 2; }
.login-modal .lm-tabs { display: flex; gap: .4rem; background: rgba(255, 255, 255, .14); padding: .3rem; border-radius: 14px; position: relative; z-index: 1; }
.login-modal .lm-tab { flex: 1; border: 0; background: transparent; color: rgba(255, 255, 255, .85); padding: .55rem .6rem; border-radius: 11px; font-weight: 500; transition: background .2s, color .2s; }
.login-modal .lm-tab.active { background: #fff; color: var(--brand); box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.login-modal .lm-pane { display: none; animation: stepIn .3s ease; }
.login-modal .lm-pane.active { display: block; }
.modal.fade .modal-dialog.login-dialog { transform: scale(.92) translateY(10px); transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); }
.modal.show .modal-dialog.login-dialog { transform: none; }

/* ---------- v1.7: สีหลักสว่าง (ส้ม) — ตัวอักษรสีหลักบนพื้นขาวใช้เฉดเข้มขึ้น และเพิ่มเงาตัวอักษรบนปุ่ม/พื้นไล่เฉด ---------- */
html:not([data-bs-theme="dark"]) .text-primary { color: var(--brand-dark) !important; }
html:not([data-bs-theme="dark"]) .public-nav .nav-link:hover, html:not([data-bs-theme="dark"]) .public-nav .nav-link.active,
html:not([data-bs-theme="dark"]) .action-card .go, html:not([data-bs-theme="dark"]) .sidebar .menu-link:hover { color: var(--brand-dark); }
.btn-primary, .sidebar .menu-link.active, .wizard-head, .hero-art, .login-art, .login-modal .lm-head, .step-pill.active .n { text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.btn-primary { font-weight: 600; }

/* ทำเนียบรุ่น */
.dir-card .thumb { position: relative; aspect-ratio: 4 / 3; }
.dir-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.dir-badge { position: absolute; left: 10px; top: 10px; font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--brand-dark, var(--brand)); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
[data-bs-theme=dark] .dir-badge { background: rgba(20,20,28,.85); color: #fff; }

/* แถบเมนูหน้าเว็บ: จอขนาดกลาง (1200–1599px) ย่อระยะและซ่อนไอคอนเมนู */
@media (min-width: 1200px) and (max-width: 1599.98px) {
  .public-nav .navbar-nav .nav-link { padding: .45rem .6rem !important; }
  .public-nav .navbar-nav .nav-link > .bi { display: none; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .public-nav .brand-title { display: none !important; }
  .public-nav .nav-admin-text { display: none; }
}

.dir-year { position: absolute; right: 10px; bottom: 10px; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); }

/* ปุ่มสมัครสมาชิกนักศึกษาชั้นปีสุดท้าย (หน้าแรก) — เด่นชัด */
.btn-pregrad { position: relative; background: var(--grad); color: #fff !important; border: 0; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.25);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 45%, transparent); transition: transform .2s, box-shadow .2s; }
.btn-pregrad:hover, .btn-pregrad:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 60%, transparent); color: #fff; }
.btn-pregrad .badge { color: var(--brand-dark, var(--brand)); text-shadow: none; font-size: .72rem; vertical-align: middle; }
.btn-pregrad::after { content: ''; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid var(--brand); opacity: 0; animation: pregradPulse 2.4s ease-out infinite; pointer-events: none; }
@keyframes pregradPulse { 0% { opacity: .55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .btn-pregrad::after { animation: none; } }

/* ตัวเลขแจ้งเตือนเปลี่ยนค่า */
.badge-pop { animation: badgePop .45s ease; }
@keyframes badgePop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
