@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Noto+Sans+Thai:wdth,wght@62.5..100,100..900&family=Sarabun:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* ═══════════════════════════════════════════════
   app.css — KPIs HUB
═══════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --pri: #4f46e5;
  --pri-l: #818cf8;
  --pri-d: #3730a3;
  --grn: #10b981;
  --grn-l: #d1fae5;
  --grn-t: #065f46;
  --red: #ef4444;
  --red-l: #fee2e2;
  --red-t: #991b1b;
  --amb: #f59e0b;
  --amb-l: #fef3c7;
  --amb-t: #92400e;
  --blu: #3b82f6;
  --blu-l: #dbeafe;
  --blu-t: #1e40af;
  --tx: #1e1b4b;
  --tx2: #6b7280;
  --tx3: #9ca3af;
  --bg: #f8f9ff;
  --bdr: #e8e6ff;
  --bdr2: #ede9fe;
  --sh: 0 1px 3px rgba(79, 70, 229, .08), 0 1px 2px rgba(0, 0, 0, .04);
  --sh2: 0 4px 20px rgba(79, 70, 229, .10), 0 2px 8px rgba(0, 0, 0, .05);
  --sh3: 0 20px 60px rgba(79, 70, 229, .14), 0 8px 24px rgba(0, 0, 0, .07);
}

/* ── Base ── */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Sarabun', sans-serif;
  color: var(--tx);
  background: var(--bg);
  font-size: 13.5px;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, a, button, .fac-chip {
  font-family: "Kanit", sans-serif !important;
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--bdr2);
  border-radius: 3px;
}

.flex-1 {
  flex: 1;
  min-width: 0;
}

.flex-2 {
  flex: 2;
}

.cursor-pointer {
  cursor: pointer;
}

.pos-relative {
  position: relative;
}

/* ── Loading Bar ── */
#lbar-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
}

#lbar {
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
  transition: width .25s ease;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(99, 102, 241, .5);
}

/* ── Page ── */
.page-wrap {
  min-height: calc(100vh - 58px);
}

.page-main {
  padding: 16px 24px 56px;
}

.page-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--tx);
}

/* ── Breadcrumb ── */
.bc {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--tx3);
  font-weight: 500;
}

.bc a {
  color: var(--pri);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.bc-sep {
  color: var(--tx3);
}

/* ── Navbar ── */
.navbar-app {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bdr);
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 8px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .28);
  flex-shrink: 0;
  cursor: pointer;
}

.logo-t {
  font-size: 14px;
  font-weight: 800;
  color: var(--pri);
  letter-spacing: -.3px;
}

.logo-s {
  font-size: 8px;
  color: var(--tx3);
  letter-spacing: 2px;
  font-weight: 600;
}

.fac-chip {
  background: linear-gradient(135deg, var(--pri), #8b5cf6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
  transition: all .2s;
  font-family: 'Sarabun', sans-serif;
}

.nav-pill:hover,
.nav-pill.active {
  background: #ede9fe;
  color: var(--pri);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: #f1f0ff;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid var(--bdr2);
  transition: all .2s;
  position: relative;
}

.ua {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
}

.user-role {
  font-size: 10px;
  color: var(--tx3);
}

.dd-arrow {
  color: var(--tx3);
  font-size: 10px;
}

.dd-menu {
  position: fixed;
  top: 62px;
  right: 16px;
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04);
  z-index: 500;
  min-width: 200px;
}

.dd-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 6px;
}

.dd-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--tx2);
  cursor: pointer;
  display: block;
  transition: all .15s;
}

.dd-item:hover {
  background: #f1f0ff;
  color: var(--pri);
}

/* ── Login ── */
.login-bg {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0f0c29, #302b63, #24243e);
  position: relative;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, .22), transparent);
}

.ptcl {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ptcl span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  animation: pfloat linear infinite;
}

@keyframes pfloat {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  10%,
  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-10vh);
    opacity: 0;
  }
}

.login-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  padding: 40px 36px;
  width: 460px;
  max-width: 95vw;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .4);
  text-align: center;
}

.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .4);
}

.login-card h1 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 1);
  line-height: 1.8;
  margin-bottom: 24px;
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  transition: all .4s;
}

.dot.active {
  background: #818cf8;
  width: 24px;
  border-radius: 4px;
}

.dot.done {
  background: #10b981;
}

.step-label {
  font-size: 12px;
  color: rgba(255, 255, 255, .45);
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}

.fac-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.fac-card {
  border: 1.5px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .04);
  user-select: none;
}

.fac-card:hover {
  border-color: rgba(129, 140, 248, .5);
  background: rgba(129, 140, 248, .1);
  transform: translateY(-2px);
}

.fac-card.sel {
  border-color: #818cf8;
  background: rgba(99, 102, 241, .15);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
}

.fac-logo {
  font-size: 22px;
  font-weight: 900;
}

.fac-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, .75);
  text-align: center;
  line-height: 1.4;
}

.role-badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
}

.role-admin {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.role-reporter {
  background: var(--blu-l);
  color: var(--blu-t);
}

.role-viewer {
  background: #f1f5f9;
  color: #64748b;
}

.btn-login {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 16px rgba(99, 102, 241, .35);
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, .45);
}

.btn-login:disabled {
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .3);
  cursor: not-allowed;
}

.back-btn {
  border: none;
  background: none;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
  padding: 0;
  font-family: 'Sarabun', sans-serif;
}

.back-btn:hover {
  color: #818cf8;
}

.sel-fac-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, .18), rgba(139, 92, 246, .12));
  border: 1px solid rgba(129, 140, 248, .3);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 16px;
}

.sel-lbl {
  font-size: 10px;
  color: rgba(129, 140, 248, .9);
  margin-bottom: 3px;
  letter-spacing: .5px;
}

.sel-name {
  font-size: 14px;
  font-weight: 700;
}

.gnote {
  font-size: 11px;
  color: rgba(255, 255, 255, .45);
  margin-bottom: 14px;
  line-height: 1.8;
}

.gnote b {
  color: #818cf8;
}

.google-btn {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all .25s;
  font-family: 'Sarabun', sans-serif;
}

.google-btn:hover {
  border-color: rgba(129, 140, 248, .5);
  background: rgba(99, 102, 241, .15);
}

.checking-txt {
  font-size: 14px;
  font-weight: 700;
  color: #818cf8;
}

/* ── Spinner ── */
.spin {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, .1);
  border-top: 3px solid #818cf8;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.spin-dark {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bdr2);
  border-top: 3px solid var(--pri);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.spin-sm {
  width: 18px;
  height: 18px;
  border: 2px solid var(--bdr2);
  border-top: 2px solid var(--pri);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f8f9ff;
  border-radius: 10px;
  font-size: 12px;
  color: var(--pri);
  font-weight: 600;
  margin-top: 8px;
}

/* ── Card ── */
.kpi-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--sh);
  border: 1px solid var(--bdr);
  margin-bottom: 16px;
}

.kpi-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ind-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--tx);
}

/* ── Search ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 24px;
  padding: 10px 18px;
  box-shadow: var(--sh2);
  width: 520px;
  max-width: 100%;
  border: 1px solid var(--bdr);
}

.search-bar input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--tx);
  background: transparent;
  font-family: 'Sarabun', sans-serif;
}

.search-icon {
  font-size: 16px;
  color: var(--tx3);
}

/* ── Group Card ── */
.g-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--sh);
  cursor: pointer;
  transition: all .25s;
  border: 1px solid var(--bdr);
  margin-bottom: 8px;
}

.g-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh2);
  border-color: var(--pri-l);
}

.g-num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.c0 {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.c1 {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
}

.c2 {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
}

.c3 {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.c4 {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.c5 {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.g-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 4px;
}

.g-arrow {
  color: var(--tx3);
  font-size: 14px;
  transition: transform .2s;
}

.g-card:hover .g-arrow {
  transform: translateX(3px);
  color: var(--pri);
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--tx3);
  font-size: 13px;
}

/* ── Detail Sidebar ── */
.detail-sidebar {
  width: 230px;
  flex-shrink: 0;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  letter-spacing: 1px;
  padding: 4px 6px;
  margin-bottom: 4px;
}

.side-c {
  background: #fff;
  border-radius: 10px;
  padding: 11px 13px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  margin-bottom: 6px;
}

.side-c:hover {
  border-color: var(--bdr2);
  box-shadow: var(--sh);
}

.side-c.active {
  border-color: var(--pri);
  background: #f1f0ff;
}

.side-c.locked {
  opacity: .6;
  cursor: not-allowed;
}

.nav-dd{
position:relative;
}

.custom-dd{
position:absolute;
top:110%;
left:0;

width:270px;

background:#fff;

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

border-radius:14px;

padding:8px;

z-index:9999;

animation:ddFade .15s;
}

.dd-head{
padding:8px 12px;

font-size:11px;

font-weight:700;

color:var(--tx3);
}

.dd-row{

display:flex;

align-items:center;

gap:10px;

padding:10px;

cursor:pointer;

border-radius:12px;

transition:.15s;
}

.dd-row:hover{
background:#f8fafc;
}

.dd-row.active{
background:#eef2ff;
}

.dd-icon{

width:34px;

height:34px;

border-radius:10px;

background:#f1f5f9;

display:flex;

align-items:center;

justify-content:center;
}

.dd-content{

flex:1;

min-width:0;
}

.dd-content small{

color:#6366f1;
}

@keyframes ddFade{

from{
opacity:0;
transform:translateY(-6px);
}

to{
opacity:1;
transform:none;
}

}

.nav-dd{
  position:relative;
}

.nav-dd .dropdown-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;

  display:block;

  min-width:320px;

  background:#fff;

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

  border-radius:16px;

  z-index:9999;
}

.s-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  line-height: 1.45;
}

/* ── Tags ── */
.tag {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tq {
  background: #ede9fe;
  color: #6d28d9;
}

.tl {
  background: #fce7f3;
  color: #be185d;
}

.ts {
  background: #f1f5f9;
  color: #64748b;
}

.ton {
  background: var(--grn-l);
  color: var(--grn-t);
}

.toff {
  background: var(--red-l);
  color: var(--red-t);
}

/* ── Data Type Badges ── */
.dt-b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.dt-general {
  background: #dbeafe;
  color: #1d4ed8;
}

.dt-compare {
  background: #d1fae5;
  color: #065f46;
}

.dt-stat {
  background: #fef3c7;
  color: #92400e;
}

.dt-statcompare {
  background: #ede9fe;
  color: #6d28d9;
}

.dt-achievement {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Status Badges ── */
.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.st-done {
  background: var(--grn-l);
  color: var(--grn-t);
}

.st-miss {
  background: var(--red-l);
  color: var(--red-t);
}

.st-pend {
  background: var(--amb-l);
  color: var(--amb-t);
}

.rv-confirmed {
  background: var(--blu-l);
  color: var(--blu-t);
}

.rv-rejected {
  background: var(--red-l);
  color: var(--red-t);
}

.rv-waiting {
  background: #ede9fe;
  color: #6d28d9;
}

/* ── Stat Blocks ── */
.smin {
  flex: 1;
  min-width: 80px;
  background: #f8f9ff;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  border: 1px solid var(--bdr);
}

.smin-lbl {
  font-size: 10px;
  color: var(--tx2);
  margin-bottom: 5px;
  font-weight: 600;
}

.smin-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--tx);
}

.stat-block {
  background: #f8f9ff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--bdr);
}

.stat-year {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  margin-bottom: 10px;
}

/* ── Progress ── */
.prog-track {
  background: #e5e7eb;
  border-radius: 5px;
  height: 8px;
  overflow: hidden;
}

.prog-bar {
  height: 100%;
  border-radius: 5px;
  transition: width .6s ease;
}

/* ── Chart ── */
.chart-wrap {
  height: 200px;
  margin-bottom: 18px;
  position: relative;
}

/* ── Buttons ── */
.btn-pri {
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, var(--pri), #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .28);
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-pri:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}

.btn-pri:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.btn-sec {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--bdr2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: #f1f0ff;
  color: var(--pri);
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-sec:hover {
  background: var(--bdr2);
}

.btn-grn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #a7f3d0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: var(--grn-l);
  color: var(--grn-t);
  transition: all .2s;
}

.btn-red {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #fecaca;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: var(--red-l);
  color: var(--red-t);
  transition: all .2s;
}

.btn-amb {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #fde68a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: var(--amb-l);
  color: var(--amb-t);
  transition: all .2s;
}

.ib {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .15s;
}

.ib-e {
  background: #ede9fe;
  color: var(--pri);
}

.ib-e:hover {
  background: var(--pri);
  color: #fff;
}

.ib-d {
  background: var(--red-l);
  color: var(--red-t);
}

.ib-d:hover {
  background: var(--red);
  color: #fff;
}

.ib-n {
  background: var(--amb-l);
  color: var(--amb-t);
}

.btn-close-x {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f8f9ff;
  border: 1px solid var(--bdr);
  cursor: pointer;
  color: var(--tx2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Forms ── */
.fg {
  margin-bottom: 14px;
}

.fl {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  margin-bottom: 5px;
  display: block;
  letter-spacing: .2px;
}

.req {
  color: var(--red);
}

.fi,
.fs,
.ft {
  width: 100%;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--bdr);
  font-size: 12px;
  color: var(--tx);
  outline: none;
  transition: all .2s;
  background: #f8f9ff;
  font-family: 'Sarabun', sans-serif;
}

.fi:focus,
.fs:focus,
.ft:focus {
  border-color: var(--pri);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.ft {
  min-height: 70px;
  resize: vertical;
}

/* ── Tabs ── */
.seg-bar {
  display: flex;
  gap: 2px;
  background: #f1f0ff;
  border-radius: 12px;
  padding: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.seg-btn {
  padding: 7px 16px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
  border-radius: 9px;
  transition: all .2s;
  font-family: 'Sarabun', sans-serif;
}

.seg-btn.active {
  background: #fff;
  color: var(--pri);
  box-shadow: var(--sh);
}

/* ── Accordion ── */
.acc-item {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--bdr);
  margin-bottom: 10px;
  overflow: hidden;
}

.acc-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background .2s;
}

.acc-head:hover {
  background: #f8f9ff;
}

.acc-body {
  border-top: 1px solid var(--bdr);
  padding: 16px 18px;
}

.acc-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--tx3);
  transition: transform .25s;
  flex-shrink: 0;
}

.acc-arrow.open {
  transform: rotate(180deg);
}

/* ── Alert ── */
.al {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 11px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
}

.al-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.al-warn {
  background: var(--amb-l);
  color: var(--amb-t);
  border: 1px solid #fde68a;
}

/* ── Approval ── */
.apr-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #f8f9ff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--bdr);
}

.apr-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pri);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 12px;
  position: relative;
  top: -4px;
}

.reviewer-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #f0fdf4;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  border: 1.5px solid #a7f3d0;
}

.reviewer-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grn);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.apr-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1.5px solid var(--bdr);
  background: #fff;
  transition: all .2s;
}

.apr-step.done {
  border-color: #6ee7b7;
  background: #f0fdf4;
}

.apr-step.current {
  border-color: var(--amb);
  background: var(--amb-l);
}

.apr-step.pending {
  opacity: .6;
}

.apr-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.apr-step-num.done {
  background: var(--grn);
}

.apr-step-num.current {
  background: var(--amb);
}

.apr-step-num.pending {
  background: #cbd5e1;
}

/* ── Modal ── */
.ov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 41, .55);
  backdrop-filter: blur(4px);
  z-index: 600;
  align-items: center;
  justify-content: center;
}

.ov.open {
  display: flex !important;
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  width: 600px;
  max-width: 96vw;
  box-shadow: var(--sh3);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-box::-webkit-scrollbar {
  width: 4px;
}

.modal-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--tx);
  margin: 0;
}

.modal-ft {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--bdr);
}

.toggle-wrap {
  display: inline-flex;
  border: 1.5px solid var(--bdr);
  border-radius: 10px;
  overflow: hidden;
}

.toggle-btn {
  padding: 7px 16px;
  border: none;
  background: #f8f9ff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  color: var(--tx2);
  font-family: 'Sarabun', sans-serif;
}

.toggle-btn.on {
  background: var(--grn-l);
  color: var(--grn-t);
}

.toggle-btn.off {
  background: var(--red-l);
  color: var(--red-t);
}

/* ── AI Box ── */
.ai-box {
  background: linear-gradient(135deg, #f5f3ff, #eff6ff);
  border-radius: 12px;
  padding: 16px;
  font-size: 12px;
  color: #3b2a7a;
  line-height: 1.9;
  border: 1px solid var(--bdr2);
  margin-top: 12px;
  white-space: pre-line;
}

.uib {
  background: linear-gradient(135deg, #f8f9ff, #f0ecff);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  flex-wrap: wrap;
  border: 1px solid var(--bdr);
}

/* ── Map ── */
.map-wrap {
  background: linear-gradient(135deg, #f0f9ff, #e8f4ff);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  height: 74vh;
  border: 1px solid var(--bdr);
  box-shadow: var(--sh);
}

.map-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
}

.map-inner {
  position: relative;
  min-width: 1000px;
  min-height: 540px;
  padding: 30px 50px;
}

.map-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.connector {
  fill: none;
  stroke: #a5b4fc;
  stroke-width: 2;
  stroke-dasharray: 6, 3;
}

.mn-root {
  position: absolute;
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(99, 102, 241, .3);
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  border: 2px solid rgba(255, 255, 255, .18);
  z-index: 10;
  line-height: 1.4;
}

.mn-goal {
  position: absolute;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(14, 165, 233, .28);
  border: 1.5px solid rgba(255, 255, 255, .2);
  z-index: 10;
  line-height: 1.35;
}

.mn-ind {
  position: absolute;
  background: #fff;
  color: var(--tx);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  border: 1.5px solid var(--bdr);
  z-index: 10;
  transition: all .2s;
}

.mn-ind:hover {
  transform: scale(1.04);
  box-shadow: var(--sh2);
  border-color: var(--pri);
}

.map-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 10px;
  color: var(--tx2);
  border: 1px solid var(--bdr);
  box-shadow: var(--sh);
}

.leg-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx2);
  margin-bottom: 8px;
  letter-spacing: .5px;
}

.leg-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.leg-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

/* ── Plan ── */
.plan-hero {
  background: linear-gradient(135deg, #1e1b4b, #312e81, #4338ca);
  color: #fff;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(67, 56, 202, .28);
}

.plan-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.plan-title {
  font-size: 15px;
  font-weight: 800;
}

.plan-sub {
  font-size: 11px;
  opacity: .6;
  margin-top: 2px;
}

.pi {
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
}

.pi-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
}

.pi-name {
  font-size: 12px;
  font-weight: 700;
}

.pi-meta {
  font-size: 10px;
  opacity: .6;
  margin-top: 2px;
}

.pi-bar-track {
  flex: 1;
  background: rgba(255, 255, 255, .15);
  border-radius: 5px;
  height: 6px;
  overflow: hidden;
}

.pi-bar {
  height: 100%;
  border-radius: 5px;
}

.pi-stat {
  text-align: right;
  flex-shrink: 0;
  min-width: 60px;
}

.pi-pct {
  font-size: 15px;
  font-weight: 800;
}

.pi-status {
  font-size: 10px;
  opacity: .6;
  margin-top: 2px;
}

/* ── Toast ── */
.toast-el {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  z-index: 9999;
  display: none;
  box-shadow: 0 8px 24px rgba(30, 27, 75, .32);
}

.toast-el.show {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .35s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes toastIn {
  from {
    transform: translateY(16px) scale(.95);
    opacity: 0
  }

  to {
    transform: none;
    opacity: 1
  }
}

/* ── Footer ── */
.app-footer {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: rgba(255, 255, 255, .45);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  flex-wrap: wrap;
  gap: 6px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar-app {
    padding: 0 12px;
  }

  .page-main {
    padding: 12px 12px 48px;
  }

  .d-flex.gap-3 {
    flex-direction: column;
  }

  .detail-sidebar {
    width: 100%;
  }

  .search-bar {
    width: 100%;
  }

  .fac-grid {
    grid-template-columns: 1fr 1fr;
  }
}

:root {
  --pri: #4f46e5;
  --pri-l: #818cf8;
  --pri-d: #3730a3;
  --grn: #10b981;
  --grn-l: #d1fae5;
  --grn-t: #065f46;
  --red: #ef4444;
  --red-l: #fee2e2;
  --red-t: #991b1b;
  --amb: #f59e0b;
  --amb-l: #fef3c7;
  --amb-t: #92400e;
  --blu: #3b82f6;
  --blu-l: #dbeafe;
  --blu-t: #1e40af;
  --tx: #1e1b4b;
  --tx2: #6b7280;
  --tx3: #9ca3af;
  --bg: #f8f9ff;
  --card: #fff;
  --bdr: #e8e6ff;
  --bdr2: #ede9fe;
  --sh: 0 1px 3px rgba(79, 70, 229, .08), 0 1px 2px rgba(0, 0, 0, .04);
  --sh2: 0 4px 20px rgba(79, 70, 229, .10), 0 2px 8px rgba(0, 0, 0, .05);
  --sh3: 0 20px 60px rgba(79, 70, 229, .14), 0 8px 24px rgba(0, 0, 0, .07);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Sarabun', sans-serif;
  color: var(--tx);
  background: var(--bg);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bdr2);
  border-radius: 3px;
}

/* LOGIN */
.login-bg {
  min-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0f0c29, #302b63, #24243e);
  position: relative;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, .22), transparent), radial-gradient(ellipse 60% 80% at 80% 100%, rgba(139, 92, 246, .18), transparent);
}

.login-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-particles span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  animation: pfloat linear infinite;
}

@keyframes pfloat {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

.login-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  padding: 40px 36px;
  width: 460px;
  max-width: 95vw;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .1);
  text-align: center;
}

.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .4);
}

.login-card h1 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -.5px;
}

.login-sub {
  font-size: 16px;
  color: rgba(255, 255, 255, 1);
  line-height: 1.8;
  margin-bottom: 24px;
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  transition: all .4s;
}

.dot.active {
  background: #818cf8;
  width: 24px;
  border-radius: 4px;
}

.dot.done {
  background: #10b981;
}

.fac-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.fac-card {
  border: 1.5px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, .04);
  user-select: none;
}

.fac-card:hover {
  border-color: rgba(129, 140, 248, .5);
  background: rgba(129, 140, 248, .1);
  transform: translateY(-2px);
}

.fac-card.sel {
  border-color: #818cf8;
  background: rgba(99, 102, 241, .15);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
}

.fac-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, .75);
  text-align: center;
  line-height: 1.4;
}

.btn-next {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 16px rgba(99, 102, 241, .35);
}

.btn-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, .45);
}

.btn-next:disabled {
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .3);
  cursor: not-allowed;
  box-shadow: none;
}

.back-btn {
  border: none;
  background: none;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
  padding: 0;
  transition: color .2s;
  font-family: 'Sarabun', sans-serif;
}

.back-btn:hover {
  color: #818cf8;
}

.sel-fac-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, .18), rgba(139, 92, 246, .12));
  border: 1px solid rgba(129, 140, 248, .3);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 16px;
}

.sel-fac-box .lbl {
  font-size: 10px;
  color: rgba(129, 140, 248, .9);
  margin-bottom: 3px;
  letter-spacing: .5px;
}

.sel-fac-box .nm {
  font-size: 14px;
  font-weight: 700;
}

.gnote {
  font-size: 11px;
  color: rgba(255, 255, 255, .45);
  margin-bottom: 14px;
  line-height: 1.8;
}

.gnote b {
  color: #818cf8;
}

.google-btn {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all .25s;
  font-family: 'Sarabun', sans-serif;
}

.google-btn:hover {
  border-color: rgba(129, 140, 248, .5);
  background: rgba(99, 102, 241, .15);
}

.spin {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, .1);
  border-top: 3px solid #818cf8;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* NAVBAR */
.navbar-app {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bdr);
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 8px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .28);
  flex-shrink: 0;
}

.logo-t {
  font-size: 14px;
  font-weight: 800;
  color: var(--pri);
  letter-spacing: -.3px;
}

.logo-s {
  font-size: 8px;
  color: var(--tx3);
  letter-spacing: 2px;
  font-weight: 600;
}

.fac-chip {
  background: linear-gradient(135deg, var(--pri), #8b5cf6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .28);
}

.nav-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
  transition: all .2s;
  font-family: 'Sarabun', sans-serif;
}

.nav-pill:hover,
.nav-pill.active {
  background: #ede9fe;
  color: var(--pri);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: #f1f0ff;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid var(--bdr2);
  transition: all .2s;
  position: relative;
}

.user-pill:hover {
  box-shadow: var(--sh);
}

.ua {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}

.dd-menu {
  position: fixed;
  top: 62px;
  right: 16px;
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04);
  z-index: 500;
  min-width: 200px;
}

.dd-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--tx2);
  cursor: pointer;
  display: block;
  text-decoration: none;
  transition: all .15s;
}

.dd-item:hover {
  background: #f1f0ff;
  color: var(--pri);
}

/* PAGE */
.app-bg {
  min-height: 100vh;
  background: var(--bg);
}

.page-main {
  padding: 0 24px 56px;
}

.bc {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--tx3);
  font-weight: 500;
}

.bc a {
  color: var(--pri);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.bc-sep {
  color: var(--tx3);
}

.cnt-badge {
  background: var(--pri);
  color: #fff;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 4px;
}

/* CARD */
.kpi-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--sh);
  border: 1px solid var(--bdr);
}

.kpi-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* STAT MINI */
.smin {
  flex: 1;
  min-width: 88px;
  background: #f8f9ff;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  border: 1px solid var(--bdr);
  transition: all .2s;
}

.smin:hover {
  border-color: var(--pri-l);
  box-shadow: var(--sh);
}

.smin-label {
  font-size: 10px;
  color: var(--tx2);
  margin-bottom: 5px;
  font-weight: 600;
}

.smin-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--tx);
}

/* TAGS */
.tag {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tq {
  background: #ede9fe;
  color: #6d28d9;
}

.tl {
  background: #fce7f3;
  color: #be185d;
}

.ts {
  background: #f1f5f9;
  color: #64748b;
}

.ton {
  background: var(--grn-l);
  color: var(--grn-t);
}

.toff {
  background: var(--red-l);
  color: var(--red-t);
}

.dt-b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.dt-general {
  background: #dbeafe;
  color: #1d4ed8;
}

.dt-compare {
  background: #d1fae5;
  color: #065f46;
}

.dt-stat {
  background: #fef3c7;
  color: #92400e;
}

.dt-statcompare {
  background: #ede9fe;
  color: #6d28d9;
}

.dt-achievement {
  background: #fee2e2;
  color: #991b1b;
}

.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.st-done {
  background: var(--grn-l);
  color: var(--grn-t);
}

.st-miss {
  background: var(--red-l);
  color: var(--red-t);
}

.st-pend {
  background: var(--amb-l);
  color: var(--amb-t);
}

.rv-confirmed {
  background: var(--blu-l);
  color: var(--blu-t);
}

.rv-rejected {
  background: var(--red-l);
  color: var(--red-t);
}

.rv-waiting {
  background: #ede9fe;
  color: #6d28d9;
}

/* GROUP CARD */
.g-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--sh);
  cursor: pointer;
  transition: all .25s;
  border: 1px solid var(--bdr);
  margin-bottom: 8px;
}

.g-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh2);
  border-color: var(--pri-l);
}

.g-card.locked {
  opacity: .6;
  cursor: not-allowed;
}

.g-card.locked:hover {
  transform: none;
  box-shadow: var(--sh);
}

.g-num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.g-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 6px;
}

.g-arrow {
  color: var(--tx3);
  font-size: 14px;
  transition: transform .2s;
}

.g-card:hover .g-arrow {
  transform: translateX(3px);
  color: var(--pri);
}

.c0 {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.c1 {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
}

.c2 {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
}

.c3 {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.c4 {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.c5 {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

/* SIDEBAR */
.side-c {
  background: #fff;
  border-radius: 10px;
  padding: 11px 13px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  margin-bottom: 6px;
}

.side-c:hover {
  border-color: var(--bdr2);
  box-shadow: var(--sh);
}

.side-c.active {
  border-color: var(--pri);
  background: #f1f0ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .08);
}

.side-c.locked-ind {
  opacity: .5;
  cursor: not-allowed;
}

.s-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  line-height: 1.45;
}

/* BUTTONS */
.btn-pri {
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, var(--pri), #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .28);
  transition: all .2s;
}

.btn-pri:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}

.btn-sec {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--bdr2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: #f1f0ff;
  color: var(--pri);
  transition: all .2s;
}

.btn-sec:hover {
  background: var(--bdr2);
}

.btn-grn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #a7f3d0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: var(--grn-l);
  color: var(--grn-t);
  transition: all .2s;
}

.btn-grn:hover {
  background: #a7f3d0;
}

.btn-amb {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #fde68a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: var(--amb-l);
  color: var(--amb-t);
  transition: all .2s;
}

.btn-amb:hover {
  background: #fde68a;
}

.btn-red {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #fecaca;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  background: var(--red-l);
  color: var(--red-t);
  transition: all .2s;
}

.btn-red:hover {
  background: #fecaca;
}

.ib {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .15s;
}

.ib-e {
  background: #ede9fe;
  color: var(--pri);
}

.ib-e:hover {
  background: var(--pri);
  color: #fff;
}

.ib-d {
  background: var(--red-l);
  color: var(--red-t);
}

.ib-d:hover {
  background: var(--red);
  color: #fff;
}

.ib-n {
  background: var(--amb-l);
  color: var(--amb-t);
}

.ib-n:hover {
  background: var(--amb);
  color: #fff;
}

/* FORMS */
.fg {
  margin-bottom: 14px;
}

.fl {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  margin-bottom: 5px;
  display: block;
  letter-spacing: .2px;
}

.req {
  color: var(--red);
}

.fi,
.fs,
.ft {
  width: 100%;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--bdr);
  font-size: 12px;
  color: var(--tx);
  outline: none;
  transition: all .2s;
  background: #f8f9ff;
  font-family: 'Sarabun', sans-serif;
}

.fi:focus,
.fs:focus,
.ft:focus {
  border-color: var(--pri);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.ft {
  min-height: 70px;
  resize: vertical;
}

/* TABS */
.seg-bar {
  display: flex;
  gap: 2px;
  background: #f1f0ff;
  border-radius: 12px;
  padding: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.seg-btn {
  padding: 7px 16px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
  border-radius: 9px;
  transition: all .2s;
  font-family: 'Sarabun', sans-serif;
}

.seg-btn.active {
  background: #fff;
  color: var(--pri);
  box-shadow: var(--sh);
}

/* ACCORDION */
.acc-item {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--bdr);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow .2s;
}

.acc-item:hover {
  box-shadow: var(--sh);
}

.acc-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background .2s;
}

.acc-head:hover {
  background: #f8f9ff;
}

.acc-body {
  border-top: 1px solid var(--bdr);
  padding: 16px 18px;
}

.acc-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--tx3);
  transition: transform .25s;
  flex-shrink: 0;
}

.acc-arrow.open {
  transform: rotate(180deg);
}

/* ALERTS */
.al {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 11px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
}

.al-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.al-warn {
  background: var(--amb-l);
  color: var(--amb-t);
  border: 1px solid #fde68a;
}

/* CHART */
.chart-wrap {
  height: 200px;
  margin-bottom: 18px;
  position: relative;
}

/* PROGRESS */
.prog-track {
  background: #e5e7eb;
  border-radius: 5px;
  height: 8px;
  overflow: hidden;
  margin-top: 6px;
}

.prog-bar {
  height: 100%;
  border-radius: 5px;
  transition: width .6s ease;
}

/* APPROVAL */
.apr-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1.5px solid var(--bdr);
  background: #fff;
  transition: all .2s;
}

.apr-step.done {
  border-color: #6ee7b7;
  background: #f0fdf4;
}

.apr-step.current {
  border-color: var(--amb);
  background: var(--amb-l);
  animation: pulseStep 1.5s infinite;
}

.apr-step.pending {
  opacity: .6;
}

.apr-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.apr-step-num.done {
  background: var(--grn);
}

.apr-step-num.current {
  background: var(--amb);
}

.apr-step-num.pending {
  background: #cbd5e1;
}

@keyframes pulseStep {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, .3);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
}

/* MAP */
.map-wrap {
  background: linear-gradient(135deg, #f0f9ff, #e8f4ff);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  height: 74vh;
  border: 1px solid var(--bdr);
  box-shadow: var(--sh);
}

.map-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
}

.map-inner {
  position: relative;
  min-width: 1000px;
  min-height: 540px;
  padding: 30px 50px;
}

.map-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.connector {
  fill: none;
  stroke: #a5b4fc;
  stroke-width: 2;
  stroke-dasharray: 6, 3;
}

.mn-root {
  position: absolute;
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(99, 102, 241, .3);
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  border: 2px solid rgba(255, 255, 255, .18);
  user-select: none;
  z-index: 10;
  line-height: 1.4;
}

.mn-goal {
  position: absolute;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(14, 165, 233, .28);
  border: 1.5px solid rgba(255, 255, 255, .2);
  line-height: 1.35;
  user-select: none;
  z-index: 10;
}

.mn-ind {
  position: absolute;
  background: #fff;
  color: var(--tx);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  border: 1.5px solid var(--bdr);
  line-height: 1.35;
  user-select: none;
  z-index: 10;
  transition: all .2s;
}

.mn-ind:hover {
  transform: scale(1.04);
  box-shadow: var(--sh2);
  border-color: var(--pri);
}

.map-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 10px;
  color: var(--tx2);
  border: 1px solid var(--bdr);
  box-shadow: var(--sh);
}

.leg-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.leg-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

/* PLAN */
.plan-hero {
  background: linear-gradient(135deg, #1e1b4b, #312e81, #4338ca);
  color: #fff;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(67, 56, 202, .28);
}

.pi {
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  transition: all .2s;
}

.pi:hover {
  background: rgba(255, 255, 255, .15);
}

.pi-bar-track {
  flex: 1;
  background: rgba(255, 255, 255, .15);
  border-radius: 5px;
  height: 6px;
  overflow: hidden;
}

.pi-bar {
  height: 100%;
  border-radius: 5px;
  transition: width .6s ease;
}

/* MODALS (custom overlay) */
.ov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 41, .55);
  backdrop-filter: blur(4px);
  z-index: 600;
  align-items: center;
  justify-content: center;
}

.ov.open {
  display: flex !important;
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  width: 600px;
  max-width: 96vw;
  box-shadow: var(--sh3);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-box::-webkit-scrollbar {
  width: 4px;
}

.modal-box::-webkit-scrollbar-thumb {
  background: var(--bdr2);
  border-radius: 2px;
}

.modal-box h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--tx);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-ft {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--bdr);
}

.toggle-wrap {
  display: flex;
  border: 1.5px solid var(--bdr);
  border-radius: 10px;
  overflow: hidden;
}

.toggle-btn {
  padding: 7px 16px;
  border: none;
  background: #f8f9ff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  color: var(--tx2);
  font-family: 'Sarabun', sans-serif;
}

.toggle-btn.on {
  background: var(--grn-l);
  color: var(--grn-t);
}

.toggle-btn.off {
  background: var(--red-l);
  color: var(--red-t);
}

.uib {
  background: linear-gradient(135deg, #f8f9ff, #f0ecff);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  flex-wrap: wrap;
  border: 1px solid var(--bdr);
}

.uib .val {
  font-weight: 700;
  color: var(--blu-t);
}

.ai-box {
  background: linear-gradient(135deg, #f5f3ff, #eff6ff);
  border-radius: 12px;
  padding: 16px;
  font-size: 12px;
  color: #3b2a7a;
  line-height: 1.9;
  border: 1px solid var(--bdr2);
  margin-top: 12px;
  white-space: pre-line;
}

/* SEARCH */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 24px;
  padding: 10px 18px;
  box-shadow: var(--sh2);
  width: 520px;
  max-width: 100%;
  border: 1px solid var(--bdr);
  transition: all .2s;
}

.search-bar:focus-within {
  border-color: var(--pri);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1), var(--sh2);
}

.search-bar input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--tx);
  background: transparent;
  font-family: 'Sarabun', sans-serif;
}

/* TOAST */
.toast-el {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  z-index: 9999;
  display: none;
  box-shadow: 0 8px 24px rgba(30, 27, 75, .32);
  border: 1px solid rgba(255, 255, 255, .1);
}

.toast-el.show {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .35s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes toastIn {
  from {
    transform: translateY(16px) scale(.95);
    opacity: 0
  }

  to {
    transform: none;
    opacity: 1
  }
}

/* FOOTER */
.app-footer {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: rgba(255, 255, 255, .45);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 500;
}

.app-footer a {
  color: #818cf8;
  text-decoration: none;
  margin-left: 14px;
  transition: color .2s;
}

.app-footer a:hover {
  color: #fff;
}

.kpi-locked-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1.5px solid var(--amb);
  border-radius: 10px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--amb-t);
  margin-bottom: 14px;
  font-weight: 700;
}

.apr-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #f8f9ff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--bdr);
}

.apr-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pri);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reviewer-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #f0fdf4;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  border: 1.5px solid #a7f3d0;
}

.reviewer-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grn);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Navbar Dropdown ── */
.dropdown-menu-nav {
  min-width: 280px;
  border: 1px solid var(--bdr);
  border-radius: 14px;
  padding: 8px;
  margin-top: 6px !important;
  background: #fff;
}

.dropdown-item-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.dropdown-item-nav:hover,
.dropdown-item-nav.active {
  background: #f5f3ff;
}

.ddi-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ddi-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
}
.ddi-sub {
  font-size: 10px;
  color: var(--tx3);
  margin-top: 1px;
}

.dropdown-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  letter-spacing: .5px;
  padding: 6px 10px 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Node type dot */
.node-type-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.nd-root     { background: #6366f1; }
.nd-goal     { background: #0ea5e9; }
.nd-strategy { background: #10b981; }
.nd-initiative { background: #f59e0b; }
.nd-indicator { background: #fff; border: 2px solid #e2e8f0; }

/* Map node depth colors */
.map-node-d0 { border-left: 3px solid #6366f1 !important; }
.map-node-d1 { border-left: 3px solid #0ea5e9 !important; }
.map-node-d2 { border-left: 3px solid #10b981 !important; }
.map-node-d3 { border-left: 3px solid #f59e0b !important; }

/* ใน <style> ท้ายไฟล์ admin.html */

.toggle-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-btn {
  flex: 1;
  padding: 8px 14px;
  border: 2px solid var(--bdr);
  border-radius: 10px;
  background: #f8f9ff;
  color: var(--tx2);
  font-size: 12px;
  font-family: 'Sarabun', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.toggle-btn.on {
  background: var(--pri);
  border-color: var(--pri);
  color: #fff;
}

.toggle-btn:hover:not(.on) {
  border-color: var(--pri);
  color: var(--pri);
  background: #f0eeff;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

button.zoom-preset {
    border: solid 2px #d8d0fd;
    border-radius: 10px;
    background: #e7e5fe;
}
button.zoom-btn {
  border-radius: 15px;
    width: 30px;
    height: 30px;
    background: #f8f9ff;
    border: solid 2px #dfeaf4;
    font-size: 12px;
    color: #6c7579;
    font-weight: 600;
}
button.ib {
    border-radius: 10px;
    background: #ffeded;
    border: solid 2px #fce8e8;
}

