/* ระบบศิษย์เก่า มรภ.หมู่บ้านจอมบึง — ธีมสีสันสดใส */

:root {
  --bg: #F2F5FA;
  --sidebar-start: #0A2A5E;
  --sidebar-end: #16479E;
  --navy: #0B2F6B;
  --royal: #1D4ED8;
  --gold: #F5B800;
  --gold-soft: #FFF6D6;
  --emerald: #0E8A43;
  --emerald-soft: #E3F5EA;
  --blue: #2563EB;
  --green: #10B981;
  --pink: #EC4899;
  --teal: #06B6D4;
  --red: #D0112B;
  --ink: #13213C;
  --muted: #6B7280;
  --white: #FFFFFF;
  --line: #E1E7F0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(11, 47, 107, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Sarabun', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-start), var(--sidebar-end));
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}

.sidebar-brand {
  padding: 26px 22px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.sidebar-brand .logo-badge {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.sidebar-brand .brand-text { font-size: 14px; line-height: 1.35; font-weight: 600; }
.sidebar-brand .brand-text small { display: block; font-weight: 400; opacity: 0.75; font-size: 12px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-nav .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.85);
  font-size: 14.5px; font-weight: 500;
  margin-bottom: 4px;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-item .icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,0.10); color: #fff; }
.sidebar-nav .nav-item.active {
  background: rgba(255,255,255,0.16);
  border-left-color: var(--gold);
  color: #fff;
}
.sidebar-nav .nav-item.disabled { opacity: 0.45; cursor: default; }
.sidebar-nav .badge {
  margin-left: auto;
  background: var(--gold);
  color: #3c2a00;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}

.sidebar-foot {
  padding: 16px 18px; border-top: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; gap: 10px; font-size: 13.5px;
}
.sidebar-foot .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: #3c2a00; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-foot .who { flex: 1; line-height: 1.3; }
.sidebar-foot .who small { opacity: 0.7; display: block; font-size: 11.5px; }
.sidebar-foot a.logout { opacity: 0.85; }
.sidebar-foot a.logout:hover { opacity: 1; }

.main {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  padding: 24px 32px 48px;
}

.topbar {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 22px;
}
.topbar .search-wrap { flex: 1; max-width: 420px; position: relative; }
.search-results {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border-radius: var(--radius-sm); box-shadow: 0 16px 40px rgba(31,27,51,0.18);
  border: 1px solid var(--line); max-height: 360px; overflow-y: auto; z-index: 40;
}
.search-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #F1F5FD; }
.search-item-main { display: flex; flex-direction: column; gap: 2px; }
.search-item-sub { color: var(--muted); font-size: 12px; }
.search-empty { padding: 16px; color: var(--muted); font-size: 13.5px; text-align: center; }
.topbar input[type="search"] {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font-family: inherit; font-size: 14px;
}
.topbar .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: 0.45; }
.topbar .top-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.topbar .bell { position: relative; font-size: 19px; color: var(--muted); }
.topbar .bell .dot {
  position: absolute; top: -3px; right: -3px; width: 9px; height: 9px;
  background: var(--red); border-radius: 50%; border: 2px solid var(--bg);
}
.topbar .user-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.topbar .user-chip .avatar-sm {
  width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}

.page-header { margin-bottom: 20px; }
.page-header h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.page-header .subtitle { color: var(--muted); font-size: 14px; margin: 0; }
.source-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--muted); margin-top: 10px;
}

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.stat-card .stat-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.stat-card .stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); }
.stat-icon.c-blue { background: var(--blue); }
.stat-icon.c-green { background: var(--green); }
.stat-icon.c-amber { background: var(--gold); }
.stat-icon.c-pink { background: var(--pink); }
.stat-icon.c-teal { background: var(--teal); }

/* ---------- Cards / forms ---------- */
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 28px; margin-bottom: 24px;
}
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card .card-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

.form-section { margin-bottom: 26px; }
.form-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
.form-section-title .tag {
  font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: #E8EEFB; color: #0B2F6B;
}
.form-section-title .tag.optional { background: #ECFDF5; color: #047857; }
.form-section.enrollment {
  border: 1.5px dashed #93B4F0; border-radius: var(--radius-sm);
  padding: 18px 20px; background: #F5F8FE;
}

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field label .req { color: var(--red); margin-left: 2px; }
.field input[type="text"],
.field input[type="tel"],
.field input[type="date"],
.field select,
.field textarea {
  font-family: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: #1D4ED8; box-shadow: 0 0 0 3px rgba(245,184,0,0.35);
}
.field.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.field.checkbox label { font-weight: 500; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 6px; }
.btn {
  font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
  padding: 11px 22px; border-radius: 999px; border: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: linear-gradient(90deg, var(--sidebar-start), var(--sidebar-end)); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: #1D4ED8; color: #0B2F6B; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Table ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tr:last-child td { border-bottom: none; }

.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.amber { background: #FEF3C7; color: #92400E; }
.pill.green { background: #D1FAE5; color: #065F46; }
.pill.gray { background: #F1F5F9; color: #475569; }

/* ---------- Flash ---------- */
.flash { padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; font-weight: 600; }
.flash.success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.flash.error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(140deg, #071F4A 0%, #0B2F6B 45%, #16479E 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 20px;
  padding: 36px 32px; box-shadow: 0 20px 50px rgba(31, 27, 51, 0.25);
}
.login-card .logo-badge {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--sidebar-start), var(--sidebar-end));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px;
}
.login-card h1 { text-align: center; font-size: 19px; margin: 0 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }
.login-card .field { margin-bottom: 16px; }

/* ---------- Public self-service pages ---------- */
.public-page {
  min-height: 100vh;
  background:
    linear-gradient(160deg, #071F4A 0%, #0B2F6B 50%, #16479E 100%);
  background-attachment: fixed;
  padding: 32px 16px 60px;
}
.public-wrap { max-width: 640px; margin: 0 auto; }
.public-hero { text-align: center; color: #fff; margin-bottom: 20px; }
.public-hero .logo-badge {
  width: 56px; height: 56px; border-radius: 16px;
  background: rgba(255,255,255,0.18);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px;
}
.public-card {
  background: #fff; border-radius: 20px; padding: 26px 22px;
  box-shadow: 0 20px 50px rgba(31,27,51,0.2); margin-bottom: 18px;
}

/* ---------- Bar chart (dashboard) ---------- */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13.5px; }
.bar-row .bar-label { width: 160px; flex-shrink: 0; color: var(--ink); }
.bar-row .bar-track { flex: 1; background: #E6ECF6; border-radius: 999px; height: 10px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 999px; }
.bar-row .bar-count { width: 46px; text-align: right; color: var(--muted); font-weight: 600; }

.view-value { padding: 10px 12px; background: #F7F7FB; border-radius: var(--radius-sm); font-size: 14px; min-height: 20px; }
.view-value .empty, .empty { color: var(--muted); font-style: italic; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 18px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field.span-3 { grid-column: span 2; }
}

/* =====================================================================
   เฟส 3 — สถานะสมาชิก 3 ระดับ / แดชบอร์ด / รายงาน / ทะเบียนติดต่อ
   ===================================================================== */
.sidebar-nav .nav-section {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  opacity: .6; margin: 14px 14px 6px; font-weight: 600;
}
.sidebar-nav .nav-section:first-child { margin-top: 0; }
.sidebar-nav .nav-item { padding: 9px 14px; font-size: 14px; margin-bottom: 2px; }
.topbar a.bell { text-decoration: none; }

/* สถานะสมาชิก */
.pill.tier-alumni      { background: #F1F5F9; color: #475569; }
.pill.tier-network     { background: #DBEAFE; color: #1E40AF; }
.pill.tier-association { background: #FEF3C7; color: #92400E; border: 1px solid #F59E0B; }
.pill.red  { background: #FEE2E2; color: #991B1B; }
.pill.blue { background: #DBEAFE; color: #1E40AF; }
.pill.sm { padding: 1px 8px; font-size: 11px; }

/* ตัวกรอง */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.filter-bar .field { min-width: 150px; }
.filter-bar .field.grow { flex: 1; min-width: 200px; }
.filter-bar .field.narrow { min-width: 90px; width: 100px; }
.filter-bar .field input[type="text"], .filter-bar .field select { padding: 9px 11px; font-size: 13.5px; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.chip { background: #E8EEFB; color: #0B2F6B; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }

/* KPI แดชบอร์ด */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  border-top: 4px solid var(--blue); color: inherit; text-decoration: none; display: block;
}
.kpi:hover { transform: translateY(-1px); }
.kpi .kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .kpi-value { font-size: 26px; font-weight: 700; line-height: 1.25; margin: 2px 0; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); }
.kpi.k-gray { border-top-color: #94A3B8; } .kpi.k-blue { border-top-color: var(--blue); }
.kpi.k-gold { border-top-color: var(--gold); } .kpi.k-green { border-top-color: var(--green); }
.kpi.k-red { border-top-color: var(--red); } .kpi.k-pink { border-top-color: var(--pink); }
.kpi.k-teal { border-top-color: var(--teal); } .kpi.k-purple { border-top-color: var(--navy); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2, .grid-3 { margin-bottom: 20px; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 360px; }
.chart-box.short { height: 220px; }

/* บันได/กรวยสถานะ */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-step { display: grid; grid-template-columns: 170px 1fr 120px; align-items: center; gap: 12px; }
.funnel-step .fs-label { font-weight: 600; font-size: 14px; }
.funnel-step .fs-label small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.funnel-step .fs-bar { height: 28px; border-radius: 8px; background: #F1F5F9; overflow: hidden; }
.funnel-step .fs-fill { height: 100%; border-radius: 8px; min-width: 3px; }
.funnel-step .fs-num { text-align: right; font-weight: 700; font-size: 15px; }
.funnel-step .fs-num small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }

/* แถบความคืบหน้า */
.progress { height: 8px; border-radius: 99px; background: #EEF2F7; overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.progress.blue > span { background: var(--blue); } .progress.gold > span { background: var(--gold); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.data-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.data-table tr.hl td { background: #FFFBEB; }
.table-scroll { overflow-x: auto; }

/* แท็บรายงาน */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.tabs a {
  padding: 10px 16px; font-weight: 600; font-size: 14px; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px; text-decoration: none;
}
.tabs a.active { color: var(--navy); border-bottom-color: var(--gold); }
.tabs a:hover { color: var(--ink); }

.callout { border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-size: 14px; }
.callout.info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E3A8A; }
.callout.warn { background: #FFFBEB; border: 1px solid #FCD34D; color: #78350F; }
.callout.gold { background: linear-gradient(90deg,#FFFBEB,#FEF3C7); border: 1px solid #F59E0B; color: #78350F; }

.contact-cell a { color: inherit; }
.contact-cell .ch { display: block; font-size: 12.5px; line-height: 1.5; }
.contact-cell .ch b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--line); position: relative; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--royal); }
.timeline li .t-date { color: var(--muted); font-size: 12px; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { min-width: 130px; }
details.row-action summary { list-style: none; cursor: pointer; }
details.row-action summary::-webkit-details-marker { display: none; }
details.row-action[open] { background: #F5F8FE; border-radius: 10px; padding: 8px; }
.btn-sm { padding: 5px 11px !important; font-size: 12.5px !important; }
.btn-gold { background: linear-gradient(90deg,#F59E0B,#FBBF24); color: #3c2a00; }
.btn-danger { background: #fff; border: 1.5px solid #FCA5A5; color: #B91C1C; }

.dup-card { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.dup-card.high { border-color: #F87171; background: #FEF2F2; }
.dup-card.mid { border-color: #FBBF24; background: #FFFBEB; }
.score { font-weight: 700; font-size: 18px; }

.report-header-print { display: none; }

@media (max-width: 1100px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .funnel-step { grid-template-columns: 120px 1fr 90px; }
}

@media print {
  .sidebar, .topbar, .filter-bar, .no-print, .tabs, .btn { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  body { background: #fff !important; }
  .card, .kpi { box-shadow: none !important; border: 1px solid #ddd; break-inside: avoid; }
  .report-header-print { display: block; text-align: center; margin-bottom: 12px; }
  .data-table { font-size: 11.5px; }
  a { color: inherit !important; text-decoration: none !important; }
}
.pill { white-space: nowrap; }
.public-card .btn { white-space: nowrap; }

/* =====================================================================
   ธีม น้ำเงิน · เขียว · เหลือง (มหาวิทยาลัยราชภัฏหมู่บ้านจอมบึง)
   ===================================================================== */
.tricolor { height: 6px; background: linear-gradient(90deg, var(--navy) 0 50%, var(--emerald) 50% 75%, var(--gold) 75% 100%); }

/* ช่องกรอกทุกชนิดให้หน้าตาเดียวกัน (เดิม password/email/number ยังไม่มีสไตล์) */
.field input[type="password"], .field input[type="email"], .field input[type="number"], .field input[type="search"], .field input[type="file"] {
  padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14.5px; background: #fff; color: var(--ink); width: 100%;
}
.field input[type="password"]:focus, .field input[type="email"]:focus, .field input[type="number"]:focus {
  outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px rgba(245,184,0,0.35);
}

/* ปุ่ม */
.btn-primary { background: linear-gradient(90deg, var(--navy), var(--royal)); color: #fff; box-shadow: 0 6px 16px rgba(11,47,107,.22); }
.btn-primary:hover { filter: none; background: linear-gradient(90deg, #0A2A5E, #1E40AF); }
.btn-gold { background: var(--gold); color: #13213C; }
.btn-gold:hover { background: #E5AB00; }
.btn-danger { border-color: #F2A3AE; color: var(--red); }

/* sidebar */
.sidebar { background: linear-gradient(180deg, var(--sidebar-start), var(--sidebar-end)); border-right: 4px solid var(--gold); }
.sidebar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--emerald) 0 50%, var(--gold) 50% 100%); }
.sidebar-brand .logo-badge { background: var(--gold); color: var(--navy); box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.sidebar-nav .nav-item.active { background: rgba(255,255,255,0.14); border-left-color: var(--gold); }
.sidebar-nav .nav-section { color: #FFD95A; opacity: .85; }
.sidebar-nav .badge { background: var(--gold); color: var(--navy); }
.sidebar-foot .avatar { background: var(--gold); color: var(--navy); }
.topbar .user-chip .avatar-sm { background: var(--navy) !important; color: #fff; }
.topbar .bell .dot { background: var(--red) !important; }

/* หัวข้อหน้า / การ์ด */
.page-header h1 { color: var(--navy); }
.page-header h1::after { content: ''; display: block; width: 56px; height: 4px; margin-top: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--emerald) 0 55%, var(--gold) 55% 100%); }
.card h2 { color: var(--navy); }
.stat-icon.c-blue { background: var(--navy); }
.stat-icon.c-amber { background: var(--gold); }
.stat-icon.c-pink { background: var(--emerald); }

/* สถานะสมาชิก */
.pill.tier-network { background: #DCE7FB; color: var(--navy); }
.pill.tier-association { background: var(--gold-soft); color: #7A5600; border: 1px solid var(--gold); }
.pill.red { background: #FDE3E7; color: #A10C22; }

/* หน้าเข้าสู่ระบบ */
.login-page { position: relative; overflow: hidden; }
.login-page::before, .login-page::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.login-page::before { width: 560px; height: 560px; right: -200px; top: -260px; border: 26px solid var(--gold); opacity: .9; }
.login-page::after { width: 420px; height: 420px; left: -170px; bottom: -210px; border: 22px solid var(--emerald); opacity: .9; }
.login-card { position: relative; z-index: 1; max-width: 400px; padding: 0; overflow: hidden; border-radius: 22px;
  box-shadow: 0 30px 60px rgba(3, 14, 38, 0.45); }
.login-card .login-body { padding: 34px 34px 30px; }
.login-card .logo-badge { width: 64px; height: 64px; border-radius: 18px; font-size: 24px;
  background: var(--navy); color: var(--gold); box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--gold); margin-bottom: 18px; }
.login-card h1 { color: var(--navy); font-size: 21px; }
.login-card .sub { margin-bottom: 26px; }
.login-card .btn-primary { padding: 13px; font-size: 16px; margin-top: 6px; }
.login-card .login-foot { background: #F5F8FE; border-top: 1px solid var(--line); padding: 12px 20px; text-align: center;
  font-size: 12.5px; color: var(--muted); }
.login-card .login-foot a { color: var(--royal); font-weight: 600; }

/* หน้าสาธารณะ */
.public-hero .logo-badge { background: var(--gold); color: var(--navy); box-shadow: 0 0 0 4px var(--navy), 0 0 0 7px var(--emerald); }
.public-page { border-top: 6px solid var(--gold); box-shadow: inset 0 6px 0 var(--emerald); }
.public-hero h1 { text-shadow: 0 2px 10px rgba(0,0,0,.2); }
.public-card { border-top: 5px solid var(--gold); }
.public-card .form-section-title .tag { background: var(--emerald-soft); color: #0A6B34; }
.consent-box { background: #F1F5FD; border-left: 4px solid var(--gold); border-radius: 12px; padding: 14px; }

/* ปุ่มแสดง/ซ่อนรหัสผ่าน */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { padding-right: 46px !important; width: 100%; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
  border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.pw-toggle:hover { color: var(--navy); background: #EEF3FC; }
.pw-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.pw-toggle[aria-pressed="true"] { color: var(--royal); }
.kpi.k-pink { border-top-color: var(--emerald); } .kpi.k-green { border-top-color: var(--emerald); }

/* ช่องวันที่แบบไทย (วัน / เดือน / ปี พ.ศ.) */
.th-date { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.th-date select:nth-of-type(1) { flex: 0 0 68px; }
.th-date select:nth-of-type(2) { flex: 1 1 118px; }
.th-date select:nth-of-type(3) { flex: 0 0 96px; }
.th-date select { padding: 10px 6px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-family: inherit;
  font-size: 14px; background: #fff; color: var(--ink); min-width: 0; width: 100%; }
.th-date select:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px rgba(245,184,0,0.35); }
.th-date-btn { border: 1.5px solid var(--line); background: #fff; color: var(--navy); border-radius: var(--radius-sm);
  padding: 9px 10px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.th-date-btn:hover { border-color: var(--royal); background: #F1F5FD; }
.th-date-btn.clear { color: var(--muted); font-size: 16px; padding: 7px 11px; }
.inline-form .th-date { min-width: 360px; }
