/* =========================================================
   1) Base / Theme
   ========================================================= */
:root{
  --bg:#f6f8fc;
  --surface:#ffffff;
  --surface-2:#fbfcfe;
  --line:rgba(15,23,42,.08);
  --text:#0f172a;
  --muted:#64748b;
  --blue:#185FA5;
  --blue-soft:#E8F4FF;
  --green:#1D9E75;
  --green-soft:#E1F5EE;
  --orange:#D97706;
  --orange-soft:#FAEEDA;
  --red:#E24B4A;
  --red-soft:#FCEBEB;
  --shadow:0 16px 40px rgba(15,23,42,.06);
  --shadow-soft:0 10px 24px rgba(15,23,42,.04);
  --radius:20px;
  --radius-lg:24px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-size:14px;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(24,95,165,.06), transparent 28%),
    radial-gradient(circle at top right, rgba(29,158,117,.05), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* =========================================================
   2) Layout wrapper
   ========================================================= */
.wrap{
  max-width:1520px;
  margin:0 auto;
  padding:14px;
}

.dashboard-wrap{
  max-width:1600px;
  margin:0 auto;
  padding:16px;
}

/* =========================================================
   3) Topbar
   ========================================================= */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:14px;
  padding:8px 0 4px;
}

.topbar-left{min-width:0}

.topbar-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.topbar-meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.topbar-sticky{
  position:sticky;
  top:8px;
  z-index:1000;
}
.topbar-year-row{
    justify-content: flex-end;
  display:flex;
  grid-template-columns:minmax(0,1fr) 48px;
  gap:10px;
margin-bottom: 15px;
flex-wrap:wrap;
  padding:10px;
  border:1px solid rgba(24,95,165,.10);
  border-radius:18px;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.btn-refresh-icon{
  width:48px !important;
  height:48px !important;
  min-width:48px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 !important;
  border-radius:16px !important;
  background:linear-gradient(135deg, #185FA5, #2563eb) !important;
  color:#fff !important;
  border:none !important;
  font-size:20px;
  font-weight:900;
  box-shadow:0 10px 24px rgba(37,99,235,.25);
  transition:.18s ease;
}

.btn-refresh-icon:hover{
  transform:rotate(90deg);
}

.meta-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:999px;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
  color:#334155;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.title{
  font-size:30px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.04em;
  color:#10233f;
}

.sub{
  margin-top:5px;
  font-size:14px;
  color:var(--muted);
  line-height:1.45;
}

/* =========================================================
   4) Shared controls / input
   ========================================================= */
.conversion-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}

.target-group{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
  flex-shrink:0;
}

.target-label-inline{
  font-size:12px;
  font-weight:800;
  color:#475569;
  white-space:nowrap;
}

/* สวยขึ้น + ยืดหยุ่นกว่าเดิม */
.target-input{
  width:clamp(120px, 35vw, 180px);
  min-width:0;
  height:44px;
  padding:0 12px;
  border:1px solid #dbe4f0;
  border-radius:14px;
  background:#fff;
  color:#0f172a;
  font-size:14px;
  font-weight:700;
  box-shadow:0 4px 12px rgba(15,23,42,.04);
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.target-input:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 4px rgba(37,99,235,.12);
}

/* =========================================================
   5) Shared card shells
   ========================================================= */
.card-shell,
.exec-card,
.compare-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-soft);
}

.card-shell{
  padding:16px;
  margin-bottom:12px;
}

.exec-card{
  background:linear-gradient(180deg,#fff 0%, #fbfdff 100%);
  border:1px solid rgba(24,95,165,.10);
  box-shadow:var(--shadow);
  padding:16px;
  margin-bottom:12px;
}

.section-title{
  font-size:18px;
  font-weight:900;
  letter-spacing:-.03em;
  color:#1f2937;
  line-height:1.2;
}

.section-title-compact{
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#667085;
}

.section-sub{
  margin-top:4px;
  font-size:13px;
  color:var(--muted);
  line-height:1.45;
}

/* =========================================================
   6) Summary / control / KPI blocks
   ========================================================= */
.summary-grid,
.control-grid,
.kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:14px 0;
}

.summary-card,
.control-card,
.control-box,
.kpi-card{
  border:1px solid rgba(15,23,42,.07);
  border-radius:18px;
  background:#fff;
  padding:13px 14px;
  min-height:120px;
  transition:.18s ease;
  background:
  linear-gradient(
    180deg,
    #ffffff 0%,
    #f8fbff 100%
  );
  border:1px solid rgba(24,95,165,.12);
box-shadow:0 14px 30px rgba(15,23,42,.08);
}

.summary-card:hover,
.control-card:hover,
.control-box:hover,
.kpi-card:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 28px rgba(15,23,42,.08);
}

.summary-card{min-height:142px}
.control-card{min-height:118px}
.kpi-card{min-height:88px}

.label-row,
.control-label,
.kpi-label{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  font-weight:800;
  color:#334155;
  margin-bottom:8px;
  min-height:30px;
}

.icon-dot{
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  flex:0 0 28px;
  font-size:14px;
  font-weight:900;
}

.icon-dot.blue{background:var(--blue-soft);color:var(--blue)}
.icon-dot.green{background:var(--green-soft);color:var(--green)}
.icon-dot.orange{background:var(--orange-soft);color:var(--orange)}
.icon-dot.red{background:var(--red-soft);color:var(--red)}

.big-number,
.control-number,
.kpi-number{
  font-variant-numeric:tabular-nums;
  font-size:27px;
  font-weight:900;
  line-height:1;
  letter-spacing:-.04em;
  color:#111827;
}

.small-note{
  margin-top:5px;
  font-size:11px;
  color:#8a8f98;
  line-height:1.45;
}

.delta{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:9px;
  font-size:12px;
  font-weight:900;
  line-height:1.25;
  font-variant-numeric:tabular-nums;
}

.delta.up{color:var(--green)}
.delta.down{color:var(--red)}
.delta.flat{color:var(--muted)}

/* =========================================================
   7) Executive note / alert
   ========================================================= */
.exec-note{
  margin-top:10px;
  border:1px solid rgba(24,95,165,.12);
  background:linear-gradient(180deg, rgba(234,243,255,.88) 0%, rgba(246,250,255,.95) 100%);
  border-radius:16px;
  padding:13px 15px;
  font-size:13px;
  color:#12396a;
  line-height:1.65;
}

.exec-note strong{
  display:block;
  margin-bottom:4px;
  font-size:13px;
  color:#0f2f57;
}

.exec-alert{
  margin-top:10px;
  padding:11px 14px;
  border-radius:16px;
  font-size:13px;
  line-height:1.55;
  border:1px solid transparent;
  font-weight:700;
}

.alert-ok{background:var(--green-soft);color:#0F6E56;border-color:rgba(15,110,86,.14)}
.alert-warn{background:var(--orange-soft);color:#854F0B;border-color:rgba(133,79,11,.14)}
.alert-danger{background:var(--red-soft);color:#A32D2D;border-color:rgba(163,45,45,.14)}

/* =========================================================
   8) Compare block (Executive)
   ========================================================= */
.compare-card{
  padding:16px;
  margin-bottom:12px;
}

.compare-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.compare-main-title{
  font-size:16px;
  font-weight:900;
  color:#1f2937;
  letter-spacing:-.02em;
}

.year-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  line-height:1;
}

.year-chip.current{
  background:var(--blue-soft);
  color:var(--blue);
  border:1px solid rgba(24,95,165,.10);
}

.year-chip.prev{
  background:#f3f4f6;
  color:#667085;
  border:1px solid rgba(15,23,42,.06);
}

.compare-inner{
  border:1px solid rgba(15,23,42,.07);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
}

.compare-grid-head,
.compare-row{
  display:grid;
  grid-template-columns:minmax(260px,1.5fr) minmax(90px,.45fr) minmax(130px,.55fr) minmax(90px,.45fr);
  gap:10px;
  align-items:center;
  padding:12px 14px;
}

.compare-grid-head{
  background:#fafbfc;
  color:#667085;
  font-size:11px;
  font-weight:900;
  letter-spacing:.02em;
  border-bottom:1px solid rgba(15,23,42,.06);
}

.compare-row{border-bottom:1px solid rgba(15,23,42,.06)}
.compare-row:nth-child(even){background:#fafcff}
.compare-row:last-child{border-bottom:none}

.compare-l{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  color:#334155;
  font-size:13px;
  font-weight:800;
}

.compare-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.compare-v{
  font-weight:900;
  font-size:15px;
  text-align:right;
  color:#111827;
  letter-spacing:-.02em;
  font-variant-numeric:tabular-nums;
}

.compare-delta{
  text-align:center;
  font-size:12px;
  font-weight:900;
  line-height:1.25;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

.compare-delta.up{color:var(--green)}
.compare-delta.down{color:var(--red)}
.compare-delta.flat{color:#64748b}

.compare-note{
  margin-top:12px;
  background:#f5f9ff;
  border:1px solid rgba(24,95,165,.10);
  border-radius:14px;
  padding:10px 12px;
  font-size:12px;
  color:#0C447C;
  line-height:1.6;
}

/* =========================================================
   9) Tabs / search / rank cards
   ========================================================= */
.tab-card{padding:16px}

.tab-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.tab-pills{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.tab-btn{
  border:1px solid rgba(15,23,42,.10);
  background:#EEF4FB;
  color:#334155;
  padding:10px 16px;
  border-radius:999px;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:.18s ease;
}

.tab-btn:hover{
  transform:translateY(-1px);
  background:#E2ECF8;
}

.tab-btn.active{
  background:#185FA5;
  color:#fff;
  border-color:#185FA5;
  box-shadow:0 10px 18px rgba(24,95,165,.18);
}

.tab-body{
  border-top:1px solid rgba(15,23,42,.06);
  padding-top:14px;
}

.tab-title{
  font-size:18px;
  font-weight:900;
  color:#111827;
  letter-spacing:-.03em;
}

.tab-sub{
  margin-top:4px;
  font-size:13px;
  color:#64748b;
  line-height:1.45;
}

.tab-hint{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 12px;
  border-radius:999px;
  background:#f5f9ff;
  border:1px solid rgba(24,95,165,.10);
  color:#185FA5;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}

.tab-tools{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:14px;
}

.tab-search,
.tab-sort{
  padding:10px 12px;
  border:1px solid rgba(15,23,42,.14);
  border-radius:12px;
  font-size:14px;
  color:#111827;
  background:#fff;
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease;
}

.tab-search:focus,
.tab-sort:focus{
  border-color:rgba(24,95,165,.55);
  box-shadow:0 0 0 4px rgba(24,95,165,.09);
}

.tab-search{max-width:320px;width:100%}
.tab-sort{max-width:260px}

.tab-hint-row{
  margin-bottom:12px;
  color:#64748b;
  font-size:12px;
  font-weight:700;
}



/* =========================================================
   Pretty rank meta pills
   ========================================================= */

.rank-meta-wrap{
  display:flex;
  flex-wrap:wrap;

  gap:10px;

  margin-top:14px;
}

.rank-meta-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;

  min-height:38px;

  padding:0 14px;

  border-radius:999px;

  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f8fbff 100%
    );

  border:1px solid rgba(15,23,42,.07);

  box-shadow:
    0 8px 18px rgba(15,23,42,.04);

  color:#334155;

  font-size:12px;
  font-weight:800;

  white-space:nowrap;
}

.rank-meta-pill strong{
  font-size:15px;
  font-weight:900;

  font-variant-numeric:tabular-nums;
}

.rank-meta-pill .meta-unit{
  color:#64748b;
}

.meta-dot{
  width:10px;
  height:10px;

  border-radius:999px;

  flex:0 0 10px;
}

/* selected */
.rank-meta-pill.selected{
  border-color:rgba(24,95,165,.12);
}

.rank-meta-pill.selected strong{
  color:#185FA5;
}

.rank-meta-pill.selected .meta-dot{
  background:#185FA5;
}

/* confirmed */
.rank-meta-pill.confirmed{
  border-color:rgba(29,158,117,.12);
}

.rank-meta-pill.confirmed strong{
  color:#1D9E75;
}

.rank-meta-pill.confirmed .meta-dot{
  background:#1D9E75;
}

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width:768px){

  .rank-meta-wrap{
    gap:8px;
  }

  .rank-meta-pill{
    width:100%;

    justify-content:flex-start;

    min-height:40px;

    padding:0 12px;
  }
}
/* =========================================================
   Rank item: compare current vs previous year
   ========================================================= */
.rank-item{
  padding:14px;
  margin-bottom:12px;
  border:1px solid rgba(15,23,42,.07);
  border-radius:18px;
  background:#fff;
  box-shadow:0 2px 0 rgba(255,255,255,.8) inset;
  transition:.18s ease;background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(24, 95, 165, .12);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}

.rank-item:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 28px rgba(15,23,42,.08);
}

.rank-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:12px;
}

.rank-left{
  display:flex;
  gap:12px;
  align-items:flex-start;
  min-width:0;
  flex:1;
}

.rank-badge{
  width:34px;
  height:34px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eef4ff;
  color:#185FA5;
  font-size:12px;
  font-weight:900;
  flex:0 0 34px;
  box-shadow:0 2px 0 rgba(255,255,255,.8) inset;
}

.rank-title{
  font-size:1.04rem;
  font-weight:900;
  line-height:1.25;
  letter-spacing:-.03em;
  color:#0f172a;
  word-break:break-word;
}

.rank-rate{
  font-size:30px;
  font-weight:900;
  line-height:1;
  letter-spacing:-.05em;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

.rank-bar{
  width:100%;
  height:14px;
  background:linear-gradient(90deg,#edf2f7,#e2e8f0);
  border-radius:999px;
  overflow:hidden;
  position:relative;
  margin-top:2px;
}

.rank-fill{
  height:100%;
  border-radius:999px;
  position:relative;
  overflow:hidden;
  box-shadow:0 8px 16px rgba(15,23,42,.10);
}

.rank-fill::after{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,0));
}

.rank-fill.green{background:linear-gradient(90deg,#0f9d58,#22c55e)}
.rank-fill.orange{background:linear-gradient(90deg,#f59e0b,#f97316)}
.rank-fill.red{background:linear-gradient(90deg,#ef4444,#dc2626)}

.rank-meta-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
  align-items:center;
}

.rank-meta-pill,
.rank-compare-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:0 14px;
  border-radius:999px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  border:1px solid rgba(15,23,42,.07);
  box-shadow:0 8px 18px rgba(15,23,42,.04);
  color:#334155;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.rank-compare-pill{
  margin-left:auto;
}
.rank-meta-pill strong,
.rank-compare-pill strong{
  font-size:15px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
  color:#111827;
}

.rank-meta-pill .meta-label,
.rank-compare-pill .meta-label{
  color:#64748b;
  font-weight:800;
}

.rank-meta-pill .meta-unit,
.rank-compare-pill .meta-unit{
  color:#64748b;
}

.meta-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  flex:0 0 10px;
}

.rank-meta-pill.selected{
  border-color:rgba(24,95,165,.12);
}

.rank-meta-pill.selected strong{
  color:#185FA5;
}

.rank-meta-pill.selected .meta-dot{
  background:#185FA5;
}

.rank-meta-pill.confirmed{
  border-color:rgba(29,158,117,.12);
}

.rank-meta-pill.confirmed strong{
  color:#1D9E75;
}

.rank-meta-pill.confirmed .meta-dot{
  background:#1D9E75;
}

.rank-compare-pill.up{
  border-color:rgba(29,158,117,.14);
}

.rank-compare-pill.up strong{
  color:#1D9E75;
}

.rank-compare-pill.down{
  border-color:rgba((191 190 190 / 14%));
  background: linear-gradient(135deg, #eaeced, #e9e9e9);
}

.rank-compare-pill.down strong{
  color:#E24B4A;
}

.rank-compare-pill.flat{
  border-color:rgba(100,116,139,.14);
}

.rank-compare-pill.flat strong{
  color:#64748b;
}

@media (max-width:768px){

    .rank-item{
    display:flex;
    flex-direction:column;
    position:relative;
    padding:16px;
    border-radius:24px;box-shadow: 0 3px 0 rgb(216 218 219) inset;
    overflow:hidden;
  }

  .rank-top{
    order:0;
    align-items:flex-start;
    margin-bottom:8px;
  }

  .rank-left{
    width:100%;
    min-width:0;
  }

  .rank-main{
    width:100%;
    min-width:0;
  }

  .rank-rate{
    position:absolute;
    top:10;
    right:15px;
    font-size:35px !important;
    line-height:1;
    letter-spacing:-.07em;
    z-index:3;
  }

  .rank-title{
    padding-right:92px;
    font-size:22px;
    line-height:1.2;
  }

  .rank-bar{
    order:1;
    margin:10px 0 12px;
    height:16px;
    border-radius:999px;
  }

  .rank-primary-wrap{
    order:2;
    display:flex;
    flex-direction:column;
    gap:8px;
    margin:0 0 10px 0;
  }

  .rank-primary-wrap .rank-meta-pill{
    width:100%;
    min-height:52px;
    border-radius:18px;
    justify-content:space-between;
    padding:0 14px;
  }

  .rank-primary-wrap .rank-meta-pill strong{
    font-size:24px;
    line-height:1;
  }

  .rank-meta-pill.total{
    background:#fff;
    border:1px solid rgba(24,95,165,.12);
    color:#334155;
    box-shadow:none;
  }

  .rank-meta-pill.total .meta-dot{
    background:#94a3b8;
  }

  .rank-meta-pill.total strong{
    color:#185FA5;
  }

  .rank-meta-pill.selected{
    background:linear-gradient(135deg,#185FA5,#2563eb);
    border:none;
    color:#fff;
    box-shadow:0 14px 30px rgba(37,99,235,.22);
  }

  .rank-meta-pill.selected .meta-label,
  .rank-meta-pill.selected .meta-unit{
    color:rgba(255,255,255,.82);
  }

  .rank-meta-pill.selected .meta-dot{
    background:#fff;
  }

  .rank-meta-pill.confirmed{
    background:linear-gradient(180deg,#f4fffa 0%,#ebfff6 100%);
    border:1px solid rgba(29,158,117,.14);
    box-shadow:none;
    color:#12795a;
  }

  .rank-meta-pill.confirmed strong{
    color:#16a34a;
  }

  .rank-meta-pill.confirmed .meta-label,
  .rank-meta-pill.confirmed .meta-unit{
    color:#12795a;
  }

  .rank-meta-pill.confirmed .meta-dot{
    background:#22c55e;
  }

  .rank-meta-wrap{
    order:3;
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:0;
    align-items:stretch;
  }

  .rank-meta-pill,
  .rank-compare-pill{
    width:100%;
    min-height:48px;
    border-radius:18px;
    justify-content:space-between;
    padding:0 14px;
  }

  .rank-meta-pill strong,
  .rank-compare-pill strong{
    font-size:22px;
  }

  .rank-compare-pill{
    margin-left:0;
  }

  .rank-compare-pill.up strong{
    color:#16a34a;
  }

  .rank-compare-pill.down strong{
    color:#ef4444;
  }

  .rank-compare-pill.flat strong{
    color:#64748b;
  }
}
.rank-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.rank-primary-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:12px 0;
}

.rank-primary-wrap .rank-meta-pill{
  box-shadow:none;
  min-height:36px;
}

.rank-primary-wrap .rank-meta-pill strong{
  font-size:16px;
}

.rank-meta-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}

.rank-primary-main{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.rank-secondary-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.rank-meta-pill.strong{
  background:linear-gradient(135deg,#185FA5,#2563eb);
  color:#fff;
  border:none;
  box-shadow:0 10px 22px rgba(37,99,235,.18);
}

.rank-meta-pill.strong .meta-label,
.rank-meta-pill.strong .meta-unit{
  color:rgba(255,255,255,.82);
}

.rank-meta-pill.strong strong{
  color:#fff;
}
.region-drill,
.project-drill{
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.region-drill:hover,
.project-drill:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 34px rgba(15,23,42,.08);
}
.school-drill{
  cursor:pointer;
  transition:.18s ease;
}

.school-drill:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 34px rgba(15,23,42,.08);
}
.rank-compare-pill{
  margin-left:auto;
}
.op-remark{
  margin-top:6px;
  font-size:12px;
  color:#a32d2d;
  background:#fcebeb;
  border:1px solid rgba(163,45,45,.14);
  border-radius:12px;
  padding:6px 10px;
  line-height:1.45;
}
@media (max-width:768px){

  .rank-title-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .rank-rate{
    margin-left:0;
  }

  .rank-primary-wrap{
    gap:8px;
  }

  .rank-primary-wrap .rank-meta-pill{
    width:100%;
    justify-content:space-between;
  }

  .rank-compare-pill{
    margin-left:0;
    width:100%;
    justify-content:space-between;
  }
}
/* =========================================================
   Compare previous year values
   ========================================================= */

.compare-prev-wrap{
  display:inline-flex;
  align-items:center;
  gap:4px;

  font-size:12px;
  font-weight:900;

  font-variant-numeric:tabular-nums;
}

.compare-prev-confirmed{
  color:#1D9E75;
}

.compare-prev-selected{
  color:#185FA5;
}

.compare-sep{
  color:#94a3b8;
}
.gender-mini-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.gender-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
}

.gender-pill.male{
  color:#185FA5;
  background:#eff6ff;
  border-color:rgba(24,95,165,.14);
}

.gender-pill.female{
  color:#D9467A;
  background:#fdf2f8;
  border-color:rgba(217,70,122,.14);
}
/* =========================================================
   10) Loading / note / operational blocks
   ========================================================= */
.loading-overlay{
  position:fixed;
  inset:0;
  background:rgba(255,255,255,.74);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:3000;
  opacity:0;
  visibility:hidden;
  transition:opacity .22s ease, visibility .22s ease;
}
.loading-box{
  min-width:240px;
  padding:18px 20px;
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 20px 48px rgba(15,23,42,.12);
  text-align:center;
}

.spinner{
  width:34px;
  height:34px;
  border-radius:50%;
  border:4px solid #dbe7f6;
  border-top-color:var(--blue);
  margin:0 auto 10px auto;
  animation:spin 1s linear infinite;
}

@keyframes spin{to{transform:rotate(360deg)}}

.muted-note{
  padding:14px;
  border:1px dashed rgba(15,23,42,.15);
  border-radius:16px;
  color:var(--muted);
  background:#fafcff;
}
#action-kpi{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.action-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.action-tab{
  appearance:none;
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
  color:#475569;
  border-radius:999px;
  padding:10px 14px;
  font-size:12px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  transition:.18s ease;
  box-shadow:0 8px 18px rgba(15,23,42,.04);
}

.action-tab strong{
  display:inline-flex;
  min-width:22px;
  height:22px;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#eef4ff;
  color:#185FA5;
  font-size:11px;
  font-weight:900;
}

.action-tab.active{
  background:#185FA5;
  color:#fff;
  border-color:#185FA5;
  box-shadow:0 10px 20px rgba(24,95,165,.18);
}

.action-tab.active strong{
  background:rgba(255,255,255,.18);
  color:#fff;
}

.action-item{
  border-left:5px solid #dbe7f6;
  overflow:hidden;
}

.action-reason{
  margin:10px 0 8px;
  border-radius:14px;
  padding:10px 12px;
  border:1px solid rgba(15,23,42,.08);
  background:#f8fbff;
}

.action-reason-label{
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#64748b;
  margin-bottom:4px;
}

.action-reason-text{
  font-size:13px;
  font-weight:700;
  line-height:1.5;
  color:#0f172a;
}

.action-reason.reason-warn{
  background:#fff7ed;
  border-color:#fed7aa;
}

.action-reason.reason-warn .action-reason-text{
  color:#9a3412;
}

.action-reason.reason-danger{
  background:#fcebeb;
  border-color:#f5c2c7;
}

.action-reason.reason-danger .action-reason-text{
  color:#a32d2d;
}

.action-reason.reason-muted{
  background:#f8fafc;
}

.action-next{
  margin-bottom:10px;
  font-size:12px;
  font-weight:900;
  color:#185FA5;
}

@media (max-width:768px){
  .action-tabs{
    gap:6px;
  }

  .action-tab{
    width:100%;
    justify-content:space-between;
  }
}
.detail-name{
  font-size:18px;
  font-weight:900;
  color:#0f172a;
  line-height:1.35;
}

.detail-sub{
  margin-top:4px;
  font-size:13px;
  color:#64748b;
}

.detail-remark{
  margin-top:8px;
  font-size:13px;
  font-weight:700;
  color:#a32d2d;
  background:#fcebeb;
  border:1px solid rgba(163,45,45,.14);
  border-radius:12px;
  padding:8px 10px;
  line-height:1.5;
}
.action-item{
  border-left:5px solid #dbe7f6;
  overflow:hidden;
}

.action-item .action-top{
  margin-bottom:10px;
}

.action-reason{
  margin:10px 0 8px;
  border-radius:14px;
  padding:10px 12px;
  border:1px solid rgba(15,23,42,.08);
  background:#f8fbff;
}

.action-reason-label{
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#64748b;
  margin-bottom:4px;
}

.action-reason-text{
  font-size:13px;
  font-weight:700;
  line-height:1.5;
  color:#0f172a;
}

.action-reason.reason-warn{
  background:#fff7ed;
  border-color:#fed7aa;
}

.action-reason.reason-warn .action-reason-text{
  color:#9a3412;
}

.action-reason.reason-danger{
  background:#fcebeb;
  border-color:#f5c2c7;
}

.action-reason.reason-danger .action-reason-text{
  color:#a32d2d;
}

.action-reason.reason-muted{
  background:#f8fafc;
}

.action-next{
  margin-bottom:10px;
  font-size:12px;
  font-weight:900;
  color:#185FA5;
}

/* =========================
   ACTION FOOTER
========================= */

.action-footer{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* ดันปุ่มไปขวา */
.action-footer .btn-action-drill{
  margin-left:auto;
}

/* =========================
   ACTION BUTTON
========================= */

.btn-action-drill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.45rem;

  min-height:40px;
  padding:.68rem 1rem;

  border:none;
  border-radius:14px;

  background:linear-gradient(
    135deg,
    #2563eb,
    #1d4ed8
  );

  color:#fff;
  font-size:.88rem;
  font-weight:700;
  line-height:1;

  white-space:nowrap;

  box-shadow:
    0 10px 24px rgba(37,99,235,.20);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    opacity .18s ease;
}

/* hover */
.btn-action-drill:hover{
  transform:translateY(-1px);

  box-shadow:
    0 14px 28px rgba(37,99,235,.26);

  color:#fff;
}

/* active */
.btn-action-drill:active{
  transform:translateY(0);
}

/* focus */
.btn-action-drill:focus{
  outline:none;

  box-shadow:
    0 0 0 4px rgba(37,99,235,.18),
    0 10px 24px rgba(37,99,235,.20);
}

/* =========================
   MOBILE
========================= */

@media (max-width:768px){

  .action-footer{
    align-items:flex-start;
  }

  .action-footer .btn-action-drill{
    margin-left:auto;
  }

  .btn-action-drill{
    min-height:36px;
    padding:.58rem .88rem;
    font-size:.82rem;
    border-radius:12px;
  }

}
.op-list{
  display:flex;
  flex-direction:column;
  gap:12px;

}

.op-item{
  border:1px solid rgba(15,23,42,.07);
  border-radius:18px;
  background:#fff;
  padding:14px;
  transition:.18s ease;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(24, 95, 165, .12);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}

.op-item:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 28px rgba(15,23,42,.08);
}

.op-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.op-left{
  display:flex;
  gap:12px;
  align-items:flex-start;
  min-width:0;
}

.op-badge{
  width:32px;
  height:32px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eef4ff;
  color:var(--blue);
  font-size:12px;
  font-weight:900;
  flex:0 0 32px;
}

.op-title{
  font-size:18px;
  font-weight:900;
  color:#111827;
  line-height:1.25;
  letter-spacing:-.03em;
  word-break:break-word;
}

.op-sub{
  margin-top:4px;
  font-size:13px;
  color:#6b7280;
  line-height:1.45;
}

.op-bar{
  width:100%;
  height:14px;
  background:#e6edf5;
  border-radius:999px;
  overflow:hidden;
  margin-top:12px;
}

.op-fill{
  height:100%;
  border-radius:999px;
  transition:width .35s ease;
}

.op-fill.green{background:linear-gradient(90deg,#16a34a,#22c55e)}
.op-fill.orange{background:linear-gradient(90deg,#d97706,#f59e0b)}
.op-fill.red{background:linear-gradient(90deg,#dc2626,#ef4444)}

.op-footer{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  font-size:11px;
  color:var(--muted);
}

.op-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.06);
  font-weight:800;
  color:#475569;
}

.badge-soft{
  display:inline-block;
  font-size:11px;
  font-weight:700;
  padding:3px 10px;
  border-radius:999px;
}

.badge-soft.bg{background:#E1F5EE;color:#0F6E56}
.badge-soft.ba{background:#FAEEDA;color:#854F0B}
.badge-soft.br{background:#FCEBEB;color:#A32D2D}

/* =========================================================
   11) Modal / detail
   ========================================================= */
.modal-content{
  border:none;
  border-radius:22px;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.modal-header{
  background:linear-gradient(135deg,#0f172a,#1e293b);
  color:#fff;
  border-bottom:none;
}

.modal-body{
  background:linear-gradient(180deg,#fff,#f8fbff);
}

.detail-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.detail-box{
  padding:14px;
  border-radius:16px;
  background:#fff;
  border:1px solid rgba(15,23,42,.06);
}

.detail-box .label{
  color:var(--muted);
  font-size:.85rem;
  font-weight:700;
}

.detail-box .value{
  margin-top:6px;
  font-weight:800;
  font-size:1rem;
  word-break:break-word;
}

/* =========================================================
   12) Priority KPI (operational)
   ========================================================= */
#priority-kpi{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin:14px 0 16px;
}

#priority-kpi .mc{
  position:relative;
  overflow:hidden;
  border-radius:20px;
  padding:16px;
  min-height:118px;
  transition:.18s ease;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(24, 95, 165, .12);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}

#priority-kpi .mc:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 30px rgba(15,23,42,.08);
}

#priority-kpi .mc::before{
  content:'';
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:linear-gradient(180deg,#185FA5,#7c3aed);
}

#priority-kpi .mc-l{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:800;
  color:#334155;
  margin-bottom:8px;
  min-height:26px;
}

#priority-kpi .mc-v{
  font-variant-numeric:tabular-nums;
  font-size:28px;
  font-weight:900;
  line-height:1;
  letter-spacing:-.04em;
  color:#111827;
}

#priority-kpi .mc-s{
  margin-top:8px;
  font-size:11px;
  line-height:1.45;
  color:#64748b;
}

/* =========================================================
   13) Priority list (operational)
   ========================================================= */
#priority-list .priority-card{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(15,23,42,.08);
  background:linear-gradient(180deg,#ffffff 0%,#fbfcff 100%);
  border-radius:20px;
  padding:18px;
  min-height:160px;
  box-shadow:0 10px 30px rgba(15,23,42,.05);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

#priority-list .priority-card:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 34px rgba(15,23,42,.08);
  border-color:rgba(24,95,165,.18);
}

#priority-list .priority-card::before{
  content:'';
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
}

#priority-list .priority-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:12px;
}

#priority-list .priority-name{
  margin:0;
  font-size:1.02rem;
  font-weight:900;
  letter-spacing:-.03em;
  color:#0f172a;
  line-height:1.3;
}

#priority-list .priority-note{
  color:var(--muted);
  margin-top:6px;
  font-size:.92rem;
  line-height:1.5;
}

#priority-list .op-rate{
  font-size:clamp(26px, 2.2vw, 34px);
  font-weight:900;
  line-height:1;
  letter-spacing:-.05em;
  white-space:nowrap;
}

#priority-list .progress-soft{
  height:14px;
  background:linear-gradient(90deg, #edf2f7, #e2e8f0);
  border-radius:999px;
  overflow:hidden;
  position:relative;
  margin-top:2px;
}

#priority-list .progress-fill{
  height:100%;
  border-radius:999px;
  position:relative;
  overflow:hidden;
  box-shadow:0 8px 16px rgba(15,23,42,.10);
}

#priority-list .progress-fill::after{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,0));
}

#priority-list .progress-fill.green{background:linear-gradient(90deg,#0f9d58,#22c55e)}
#priority-list .progress-fill.orange{background:linear-gradient(90deg,#f59e0b,#f97316)}
#priority-list .progress-fill.red{background:linear-gradient(90deg,#ef4444,#dc2626)}

#priority-list .priority-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

#priority-list .op-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.06);
  font-size:11px;
  font-weight:800;
  color:#475569;
}

#priority-list .badge-soft{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}

#priority-list .badge-soft.bg{background:#E1F5EE;color:#0F6E56}
#priority-list .badge-soft.ba{background:#FAEEDA;color:#854F0B}
#priority-list .badge-soft.br{background:#FCEBEB;color:#A32D2D}

.trend-main{
  flex:1;
  min-width:0;
}

.trend-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.trend-rate{
  font-size:18px;
  font-weight:900;
  letter-spacing:-.03em;
  flex:0 0 auto;
}

.trend-rate.green{
  color:#16a34a;
}

.trend-rate.orange{
  color:#d97706;
}

.trend-rate.red{
  color:#dc2626;
}

.trend-inline-meta{
  margin-top:8px;

  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.trend-chip{
  display:inline-flex;
  align-items:center;

  padding:5px 10px;

  border-radius:999px;

  font-size:12px;
  font-weight:800;

  line-height:1.2;
}

.trend-chip.current{
  background:#eff6ff;
  color:#1d4ed8;
}

.trend-chip.prev{
  background:#f8fafc;
  color:#64748b;
}

.trend-status-row{
  margin-top:12px;

  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.trend-recommend{
  font-size:12px;
  font-weight:700;
  color:#64748b;
}

.op-bar{
  height:10px;
}
/* =========================
   GEO SECTION
========================= */
.geo-section{
  display:flex;
  flex-direction:column;
  gap:18px;
}

/* =========================
   GEO HEADER
========================= */
.geo-head{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:24px;
  align-items:start;
  margin-bottom:0;
}

.geo-head-left{
  min-width:0;
}

.geo-kicker{
  display:inline-flex;
  align-items:center;
  padding:6px 12px;
  border-radius:999px;
  background:#eff6ff;
  color:#2563eb;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:10px;
}

.geo-title{
  margin:0;
  font-size:1.8rem;
  font-weight:900;
  color:#111827;
  letter-spacing:-.04em;
  line-height:1.1;
}

.geo-sub{
  margin-top:10px;
  max-width:760px;
  font-size:.95rem;
  line-height:1.6;
  color:#64748b;
}

.geo-head-right{
  flex-shrink:0;
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
}


/* =========================
   GEO KPI GRID
========================= */
.geo-kpi-grid{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.geo-kpi-grid .kpi-card{
  min-height:120px;
}

/* =========================
   GEO ALERT
========================= */
.geo-alert{
  padding:14px;
  border-radius:16px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
}

.geo-alert-text{
  margin-top:6px;
  color:#334155;
}

.geo-recommend{
  margin-top:10px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.geo-recommend-text{
  font-size:.92rem;
  color:#475569;
  font-weight:600;
}

/* =========================
   GEO LIST
========================= */
.geo-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.geo-item{
  cursor:default;
}

.geo-meta-row{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.geo-footer{
  justify-content:flex-start;
  gap:8px;
}

.geo-next-btn{
  margin-left:auto;
}
/* =========================
   GEO BREADCRUMB
========================= */

.geo-breadcrumb{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
  align-items:center;
}

.geo-crumb{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  border:1px solid #dbe3ef;
  background:#fff;
  color:#334155;

  border-radius:999px;
  padding:.52rem .95rem;

  font-size:.88rem;
  font-weight:800;
  line-height:1;

  box-shadow:0 8px 18px rgba(15,23,42,.05);
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.geo-crumb:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(15,23,42,.08);
}

.geo-crumb.active{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
  box-shadow:0 10px 24px rgba(37,99,235,.22);
}

/* =========================
   GEO ITEM LAYOUT
========================= */

.geo-item{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.geo-item .op-top{
  order:1;
}

.geo-item .geo-meta-row{
  order:2;
}

.geo-item .op-bar{
  order:3;
}

.geo-item .op-footer{
  order:4;
}
.geo-item .rank-rate{
  flex:0 0 auto;
}
/* =========================
   MOBILE REORDER
========================= */

@media (max-width:768px){

  .geo-breadcrumb{
    justify-content:flex-start;
    width:100%;
  }

  .geo-crumb{
    font-size:.82rem;
    padding:.48rem .82rem;
  }

  .geo-item{
    gap:10px;
  }

  /* ให้แถบ progress อยู่ใต้หัวการ์ดทันที */
  .geo-item .op-top{
    order:1;
    align-items:flex-start;
  }

  .geo-item .op-bar{
    order:2;
    margin-top:2px;
  }

  .geo-item .geo-meta-row{
    order:3;
  }

  .geo-item .op-footer{
    order:4;
    gap:8px;
  }

  .geo-item .geo-next-btn{
    margin-left:0;
    width:100%;
  }

  .geo-item .rank-rate{
    white-space:nowrap;
  }
   .geo-item .rank-rate{
    margin-left:auto;

    font-size:1.4rem;
    line-height:1;
right: 45px;
    text-align:right;

    padding-left:10px;

    white-space:nowrap;
  }

  .geo-item .op-top{
    gap:10px;
  }

  .geo-item .op-left{
    min-width:0;
    flex:1;
  }
}
/* =========================
   TREND STAT BLOCK
========================= */
.trend-stat-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.trend-stat{
  border-radius:14px;
  padding:12px;
  border:1px solid rgba(15,23,42,.06);
}

.trend-stat.current{
  background:#eff6ff;
  border-color:#bfdbfe;
}

.trend-stat.prev{
  background:#f8fafc;
}

.trend-stat-label{
  font-size:12px;
  font-weight:800;
  margin-bottom:8px;
  color:#334155;
}

.trend-stat-row{
  display:flex;
  justify-content:space-between;
  gap:8px;
  font-size:12px;
  padding:4px 0;
  color:#475569;
}

.trend-stat-row strong{
  font-size:13px;
  font-weight:900;
  color:#0f172a;
}

/* =========================
   MOBILE
========================= */
@media (max-width:768px){
  .geo-head{
    grid-template-columns:1fr;
    gap:16px;
  }

  .geo-title{
    font-size:1.4rem;
  }

  .geo-sub{
    font-size:.9rem;
  }

  .geo-head-right{
    width:100%;
  }

  .geo-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .geo-footer{
    gap:8px;
  }

  .geo-next-btn{
    margin-left:0;
    width:100%;
  }
}
.trend-stat-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.trend-stat{
  border-radius:14px;
  padding:12px;
  border:1px solid rgba(15,23,42,.06);
}

.trend-stat.current{
  background:#eff6ff;
  border-color:#bfdbfe;
}

.trend-stat.prev{
  background:#f8fafc;
}

.trend-stat-label{
  font-size:12px;
  font-weight:800;
  margin-bottom:8px;
  color:#334155;
}

.trend-stat-row{
  display:flex;
  justify-content:space-between;
  gap:8px;
  font-size:12px;
  padding:4px 0;
  color:#475569;
}

.trend-stat-row strong{
  font-size:13px;
  font-weight:900;
  color:#0f172a;
}
/* =========================================================
   Priority meta
   ========================================================= */
.priority-meta{
  display:flex;
  flex-wrap:wrap;

  align-items:center;

  gap:8px;

  margin-top:12px;
}

/* meta pill */
.priority-meta .op-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;

  min-height:30px;

  padding:0 10px;

  border-radius:999px;

  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f8fbff 100%
    );

  border:1px solid rgba(15,23,42,.06);

  color:#475569;

  font-size:11px;
  font-weight:800;

  white-space:nowrap;
}

/* badge */
.priority-meta .badge-soft{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-height:30px;

  padding:0 10px;

  border-radius:999px;

  font-size:11px;
  font-weight:900;

  white-space:nowrap;
}

.priority-meta .badge-soft.bg{
  background:#E1F5EE;
  color:#0F6E56;
}

.priority-meta .badge-soft.ba{
  background:#FAEEDA;
  color:#854F0B;
}

.priority-meta .badge-soft.br{
  background:#FCEBEB;
  color:#A32D2D;
}
/* =========================================================
   Primary detail button
   ========================================================= */
.btn-detail{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  min-height:40px;
  padding:0 16px;

  border:none;
  border-radius:14px;

  background:
    linear-gradient(
      135deg,
      #185FA5,
      #2563eb
    );

  color:#fff;

  font-size:13px;

  box-shadow:
    0 10px 24px rgba(37,99,235,.22);

  transition:.18s ease;
}

.btn-detail:hover{
  transform:translateY(-1px);

  box-shadow:
    0 14px 30px rgba(37,99,235,.28);
}
/* =========================================================
   Load more button
   ========================================================= */
.btn-loadmore{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  min-height:42px;
  padding:0 16px;

  border-radius:999px;

  border:1px solid rgba(24,95,165,.10);

  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f8fbff 100%
    );

  color:#185FA5;

  font-size:13px;
  font-weight:800;

  cursor:pointer;

  box-shadow:
    0 6px 16px rgba(15,23,42,.05);

  transition:.18s ease;
}

.btn-loadmore:hover{
  transform:translateY(-1px);

  border-color:rgba(24,95,165,.22);

  background:#f4f9ff;
}

.load-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:18px;
  height:18px;

  border-radius:999px;

  background:#e8f4ff;

  font-size:12px;
  font-weight:900;

  line-height:1;
}

.load-count{
  color:#64748b;
  font-size:12px;
  font-weight:700;
}

/* loading state */
.btn-loadmore.is-loading .load-icon{
  animation:spin .9s linear infinite;
}

@keyframes spin{
  to{
    transform:rotate(360deg);
  }
}
/* =========================================================
   Filter label
   ========================================================= */

.filter-label{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:max-content;

  padding:5px 12px;

  border-radius:999px;

  background:
    linear-gradient(
      135deg,
      #eef4ff 0%,
      #e8f2ff 100%
    );

  border:1px solid rgba(24,95,165,.10);

  color:#185FA5;

  font-size:10px;
  font-weight:900;

  letter-spacing:.12em;
  text-transform:uppercase;

  line-height:1;

  box-shadow:
    0 6px 14px rgba(24,95,165,.08);
}

/* =========================================================
   Desktop
   ========================================================= */

.topbar-year-row{
  position:relative;

  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;

  flex-wrap:wrap;

  padding:14px 16px;

  border-radius:22px;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,.96) 0%,
      rgba(248,251,255,.96) 100%
    );

  border:1px solid rgba(24,95,165,.10);

  box-shadow:
    0 10px 24px rgba(15,23,42,.05);
}

.topbar-year-row {
  margin-right:auto;
}
.drill-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.drill-tab{
  border:1px solid #dbe3ef;
  background:#fff;
  border-radius:999px;
  padding:.55rem .9rem;
  display:flex;
  align-items:center;
  gap:.55rem;
  font-size:.9rem;
  font-weight:600;
}

.drill-tab.active{
  background:#0d6efd;
  color:#fff;
  border-color:#0d6efd;
}

.drill-tab strong{
  background:rgba(0,0,0,.08);
  padding:.1rem .45rem;
  border-radius:999px;
}
/* =========================
   DRILL KPI GRID
========================= */

.drill-kpi-grid{
  display:grid;
  grid-template-columns:
    repeat(6,minmax(0,1fr));

  gap:14px;
  margin-bottom:18px;
}

/* =========================
   KPI CARD
========================= */

.school-kpi{
  position:relative;

  display:flex;
  flex-direction:column;
  gap:6px;

  padding:16px 18px;

  border-radius:18px;

  background:
    linear-gradient(
      180deg,
      #ffffff,
      #f8fafc
    );

  border:1px solid #e2e8f0;

  min-height:96px;

  overflow:hidden;
}

/* top accent */
.school-kpi::before{
  content:'';

  position:absolute;
  top:0;
  left:0;
  right:0;

  height:4px;

  background:
    linear-gradient(
      90deg,
      #2563eb,
      #60a5fa
    );
}

/* label */
.school-kpi-label{
  font-size:.78rem;
  font-weight:600;
  color:#64748b;

  line-height:1.2;
}

/* value */
.school-kpi-value{
  font-size:1.55rem;
  font-weight:800;
  line-height:1;

  color:#0f172a;

  letter-spacing:-0.02em;
}

/* =========================
   TABLE WRAP
========================= */

.school-table-wrap{
  border:1px solid #e2e8f0;
  border-radius:18px;
  overflow:auto;
  background:#fff;
}

/* =========================
   DRILL STATUS TABS
========================= */

.drill-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;

  margin-bottom:16px;
}

.drill-tab{
  border:1px solid #dbe3ef;
  background:#fff;

  border-radius:999px;

  padding:.58rem .95rem;

  display:inline-flex;
  align-items:center;
  gap:.55rem;

  font-size:.88rem;
  font-weight:700;

  transition:
    background .18s ease,
    border-color .18s ease,
    transform .18s ease;
}

.drill-tab:hover{
  transform:translateY(-1px);
}

.drill-tab strong{
  background:rgba(15,23,42,.06);

  border-radius:999px;

  padding:.12rem .5rem;

  font-size:.78rem;
}

.drill-tab.active{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
}

.drill-tab.active strong{
  background:rgba(255,255,255,.18);
  color:#fff;
}

/* =========================
   STATUS BADGE
========================= */

.school-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-width:100px;

  padding:.38rem .7rem;

  border-radius:999px;

  font-size:.78rem;
  font-weight:700;
}

.school-status.success{
  background:#dcfce7;
  color:#166534;
}

.school-status.warn{
  background:#fef3c7;
  color:#92400e;
}

.school-status.danger{
  background:#fee2e2;
  color:#991b1b;
}

.school-status.info{
  background:#dbeafe;
  color:#1d4ed8;
}

.school-status.muted{
  background:#e2e8f0;
  color:#475569;
}

/* =========================
   MOBILE
========================= */

@media (max-width:768px){

  .drill-kpi-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr));

    gap:10px;
  }

  .school-kpi{
    min-height:84px;
    padding:14px;
    border-radius:16px;
  }

  .school-kpi-value{
    font-size:1.2rem;
  }

  .drill-tabs{
    overflow:auto;
    flex-wrap:nowrap;
    padding-bottom:4px;
  }

  .drill-tab{
    white-space:nowrap;
    flex:0 0 auto;
  }

}
.branch-drill{
  cursor:pointer;
}
.branch-drill:hover{
  transform:translateY(-1px);
}
.school-drill{
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.school-drill:hover{
  transform:translateY(-2px);
  border-color:rgba(24,95,165,.18);
  box-shadow:0 16px 34px rgba(15,23,42,.08);
}

.school-drill:focus-visible{
  outline:3px solid rgba(37,99,235,.18);
  outline-offset:2px;
}

.school-modal .modal-header{
  background:linear-gradient(135deg,#0f172a,#1e293b);
  color:#fff;
  border-bottom:none;
}

.school-modal .modal-body{
  background:linear-gradient(180deg,#fff 0%, #f8fbff 100%);
}

.school-modal-kicker{
  font-size:10px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#93c5fd;
  margin-bottom:4px;
}

.school-modal-sub{
  margin-top:4px;
  font-size:13px;
   color:rgba(255,255,255,.72);
}

.school-modal-sub{
  margin-top:6px;
  padding-top:6px;
  border-top:1px solid rgba(255,255,255,.15);
  color:#cbd5e1;
}

.school-kpi{
  border:1px solid rgba(15,23,42,.07);
  border-radius:18px;
  background:#fff;
  padding:12px 14px;
  box-shadow:0 8px 18px rgba(15,23,42,.04);
}

.school-kpi-label{
  font-size:12px;
  font-weight:800;
  color:#64748b;
}

.school-kpi-value{
  margin-top:4px;
  font-size:22px;
  font-weight:900;
  color:#0f172a;
  line-height:1;
}

.school-table-wrap{
  border:1px solid rgba(15,23,42,.08);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
}

.school-table{
  margin:0;
}

.school-table thead th{
  background:#f8fbff;
  color:#334155;
  font-size:12px;
  font-weight:900;
  border-bottom:1px solid rgba(15,23,42,.08);
}

.school-status{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}

.school-status.success{
  background:#e1f5ee;
  color:#0f6e56;
}

.school-status.warn{
  background:#faeeda;
  color:#854f0b;
}

.school-status.danger{
  background:#fcebeb;
  color:#a32d2d;
}

.school-status.muted{
  background:#eef2f7;
  color:#475569;
}
.student-name{
  font-weight:800;
  color:#0f172a;
  line-height:1.35;
}

.student-meta{
  margin-top:2px;
  font-size:11px;
  color:#64748b;
}
@media (max-width:768px){
  .school-modal-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
/* =========================================================
   Mobile
   ========================================================= */

@media (max-width:768px){

  .topbar-year-row{
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding:
      22px 12px 12px;
  }

  .topbar-year-row .filter-label{

    top:-10px;
    left:14px;
    margin:0;
    z-index:5;
    background:
      linear-gradient(
        135deg,
        #185FA5 0%,
        #2563eb 100%
      );

    color:#fff;
    border:none;
    box-shadow:
      0 10px 22px rgba(37,99,235,.22);
  }

  .topbar-filter-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) 50px;
    gap:10px;
    align-items:center;
  }

  #curriculum-sel,
  #yr-sel{
    width:100% !important;
  }

  #btn-refresh{
    width:50px !important;
    height:50px !important;
    min-width:50px !important;
  }
}
.btn-select {
font-size: 14px;
        font-weight: 800;
    height: 48px;
    padding: 0 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%) !important;
    border: 1px solid #d7e5f5 !important;
    }
/* =========================================================
   Flat button / school search button
   ========================================================= */
.btn-flat{
  appearance:none;
  border:none;
  outline:none;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  min-height:44px;

  padding:0 16px;

  border-radius:14px;

  background:
    linear-gradient(
      135deg,
      #185FA5,
      #2563eb
    );

  color:#fff;

  font-size:13px;
  font-weight:800;
  letter-spacing:.01em;

  cursor:pointer;

  box-shadow:
    0 10px 24px rgba(37,99,235,.22);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    opacity .18s ease;
}

.btn-flat:hover{
  transform:translateY(-1px);

  box-shadow:
    0 14px 30px rgba(37,99,235,.28);
}

.btn-flat:active{
  transform:translateY(0);
}

.btn-flat:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}
/* =========================================================
   School search button
   ========================================================= */
.btn-school-search{
  min-width:140px;
}

.btn-school-search i{
  font-size:14px;
}
/* =========================================================
   Mobile fix: summary cards should stay readable on phone
   ========================================================= */
@media (max-width:768px){
 .priority-meta{
    gap:6px;

    margin-top:10px;
  }

  .priority-meta .op-pill,
  .priority-meta .badge-soft{
    font-size:10px;

    min-height:28px;

    padding:0 9px;
  }
  /* ให้การ์ดสรุป 2 ใบแรกไม่ยาวเป็นเส้นเดียว */
  #exec-summary{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }

  /* ปรับการ์ดให้แน่นขึ้นนิดหน่อย แต่ยังหายใจได้ */
  #exec-summary .summary-card{
    min-height:132px;
    padding:14px 12px;
    border-radius:20px;
  }

  /* หัวข้อบนการ์ด */
  #exec-summary .summary-label{
    margin-bottom:6px;
    font-size:12px;
    line-height:1.25;
  }

  /* ตัวเลขหลัก */
  #exec-summary .summary-value{
    font-size:28px;
    line-height:1;
    margin-bottom:4px;
  }

  /* ค่าขึ้น/ลง */
  #exec-summary .summary-delta{
    margin-top:4px;
    font-size:11px;
  }

  /* คำอธิบายล่างการ์ด */
  #exec-summary .summary-sub{
    margin-top:4px;
    font-size:11px;
    line-height:1.35;
  }
  .control-card,
.control-box{
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:145px;
  padding:18px;
  border-radius:22px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  border:1px solid rgba(24,95,165,.12);
  box-shadow:0 14px 30px rgba(15,23,42,.08);
}

  .topbar{
    flex-direction:column;
    gap:12px;
  }

  .topbar-left{
    width:100%;
  }

  .topbar-right{
    width:100%;
    display:flex !important;
    flex-direction:column !important;
    gap:10px;
    align-items:stretch !important;
    justify-content:flex-start !important;
    overflow:visible !important;
    position:static !important;
    padding:0 !important;
    border:none !important;
    background:transparent !important;
    box-shadow:none !important;
  }

  .topbar-meta{
    width:100%;
    display:flex !important;
    flex-direction:column !important;
    gap:8px;
  }

  .meta-chip{
    width:100%;
    justify-content:center;
    text-align:center;
  }
 .topbar-year-row{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;

    width:100%;

    padding:12px;

    border-radius:22px;

    background:
      linear-gradient(
        180deg,
        rgba(255,255,255,.96) 0%,
        rgba(248,251,255,.96) 100%
      );

    border:1px solid rgba(24,95,165,.10);

    box-shadow:
      0 12px 30px rgba(15,23,42,.06);
  }

  .topbar-filter-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) 54px;
    gap:10px;
    align-items:center;
  }

  #yr-sel,
  #curriculum-sel{
    width:100% !important;
    height:48px;

    border-radius:16px !important;

    font-size:14px;
    font-weight:800;

    padding:0 14px;

    background:
      linear-gradient(
        180deg,
        #ffffff 0%,
        #f7fbff 100%
      ) !important;

    border:1px solid #d7e5f5 !important;

    box-shadow:
      0 6px 16px rgba(15,23,42,.05);
  }

  #btn-refresh{
    width:54px !important;
    height:54px !important;

    border-radius:18px !important;

    flex:none !important;
  }
  .topbar-year-spacer{
    height:72px;
  }
   /* ให้ฟิลด์เป้าหมายลงบรรทัดใหม่และเต็มความกว้าง */
  .target-group{
    width:100%;
    margin-left:0;
    display:grid;
    grid-template-columns:1fr;
    gap:6px;
  }

  .target-label-inline{
    white-space:normal;
  }

  .target-input{
    width:100%;
    max-width:none;
  }
    /* =====================================================
     Mobile : control summary
     ===================================================== */
  .control-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px;
  }

  .control-card,
  .control-box{
    min-height:132px !important;

    padding:14px 12px !important;

    border-radius:20px;

    align-items:center;
    justify-content:center;
    text-align:center;
  }

  .control-label{
    justify-content:center;

    margin-bottom:6px;

    font-size:12px;
    line-height:1.25;
  }

  .control-number,
  .control-value{
    font-size:28px !important;

    line-height:1;

    margin-bottom:4px;
  }

  .control-delta{
    margin-top:4px;

    font-size:11px;
  }

  .control-sub{
    margin-top:4px;

    font-size:11px;
    line-height:1.35;
  }
    .conversion-top{
    flex-direction:column;
    align-items:stretch;
  }

  .target-group{
    width:100%;
  }

  .target-input{
    width:100%;
  }
/* ให้ compare card หายใจได้บนมือถือ */
/* card หลัก */
  .compare-card{
    padding:12px !important;
  }

  /* header ด้านบน */
  .compare-head{
    margin-bottom:10px;
    gap:8px;
  }

  .compare-main-title{
    font-size:15px;
    line-height:1.25;
  }

  /* ซ่อนหัวตารางบนมือถือ */
  .compare-grid-head{
    display:none !important;
  }

  /* แถวข้อมูล: เปลี่ยนจากตารางเป็นการ์ดแนวตั้ง */
  .compare-row{
    display:block !important;
    padding:14px 12px !important;
    margin-bottom:10px;
    border:1px solid rgba(15,23,42,.07);
    border-radius:18px;
    background:#fff;
    box-shadow:0 10px 22px rgba(15,23,42,.04);
  }

  .compare-row:nth-child(even){
    background:#fff;
  }

  /* บรรทัดชื่อ */
  .compare-l{
    display:flex;
    align-items:flex-start;
    gap:8px;
    min-width:0;
    margin-bottom:8px;
  }

  .compare-name{
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    word-break:break-word;
    line-height:1.35;
    font-size:13px;
  }

  /* ตัวเลข */
  .compare-v{
    text-align:left !important;
    font-size:18px;
    line-height:1.1;
    margin-top:2px;
  }

  /* delta */
  .compare-delta{
    text-align:left !important;
    white-space:normal !important;
    margin-top:4px;
    font-size:11px;
    line-height:1.35;
  }

  .compare-note{
    font-size:11px;
    line-height:1.45;
    padding:10px 12px;
  }
    /* ทำให้เป็น 2 คอลัมน์ เหมือน summary */
  #priority-kpi{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }

  /* การ์ดให้เตี้ยลงและอ่านง่ายขึ้น */
  #priority-kpi .mc{
    padding:14px 12px !important;
    min-height:132px !important;
    border-radius:20px;
  }

  /* หัวข้อการ์ด */
  #priority-kpi .mc-l{
    justify-content:center;
    text-align:center;
    margin-bottom:6px;
    font-size:12px;
    line-height:1.25;
  }

  /* ตัวเลขหลัก */
  #priority-kpi .mc-v{
    text-align:center;
    font-size:28px !important;
    line-height:1;
    margin-bottom:4px;
  }

  /* คำอธิบายล่าง */
  #priority-kpi .mc-s{
    text-align:center;
    margin-top:4px;
    font-size:11px;
    line-height:1.35;
  }

  .kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }

  .kpi-card{
    padding:14px 12px !important;
    min-height:132px !important;
    border-radius:20px;
  }

  .kpi-label{
    justify-content:center;
    text-align:center;
    margin-bottom:6px;
    font-size:12px;
    line-height:1.25;
  }

  .kpi-number{
    text-align:center;
    font-size:28px !important;
    line-height:1;
    margin-bottom:4px;
  }

  .small-note{
    text-align:center;
    margin-top:4px;
    font-size:11px;
    line-height:1.35;
  }

}
.compare-prev-wrap{
  position:relative;
  display:inline-flex;
  align-items:center;

  gap:2px;

  cursor:help;

  transition:.18s ease;
}

.compare-prev-wrap:hover{
  opacity:.9;
}

.compare-prev-selected{
  color:#475569;
  font-weight:800;
}

.compare-prev-confirmed{
  color:#1D9E75;
  font-weight:900;
}

.compare-prev-gap{
  color:#E24B4A;
  font-weight:900;
}

.compare-sep{
  opacity:.35;
  margin:0 1px;
}

/* =========================================================
   DRILL MODAL : ACTION BUTTONS
========================================================= */

.modal-tools{
  display:flex;
  align-items:center;
  gap:8px;

  margin-left:auto;
  margin-right:12px;
}

.modal-tools .btn-flat{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-height:38px;
  padding:0 14px;

  border:none;
  border-radius:10px;

  background:#2563eb;
  color:#fff;

  font-size:13px;
  font-weight:700;

  cursor:pointer;
  transition:.18s ease;
}

.modal-tools .btn-flat:hover{
  background:#1d4ed8;
  transform:translateY(-1px);
}/* =========================================================
   DRILL MODAL : HEADER
========================================================= */

#schoolDrillModal .modal-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 18px;
  background:linear-gradient(135deg,#0f172a,#1e293b);
  color:#fff;
  border-bottom:none;
}

#schoolDrillModal .modal-head-main{
  flex:1;
  min-width:0;
}

#schoolDrillModal .modal-title{
  margin:0;
  color:#fff;
  font-size:1.15rem;
  font-weight:900;
  line-height:1.2;
}

#schoolDrillModal .school-modal-sub{
  margin-top:4px;
  font-size:12px;
  line-height:1.35;
  color:rgba(255,255,255,.78) !important;
}

/* =========================================================
   DRILL MODAL : TOOLS
========================================================= */

#schoolDrillModal .modal-tools{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
  flex:0 0 auto;
}

#schoolDrillModal .modal-tools .btn-flat{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-height:36px;
  padding:0 14px;

  border:none;
  border-radius:12px;

  background:#2563eb;
  color:#fff;

  font-size:13px;
  font-weight:700;

  cursor:pointer;
  transition:.18s ease;
}

#schoolDrillModal .modal-tools .btn-flat:hover{
  transform:translateY(-1px);
  background:#1d4ed8;
}

/* close button */
#schoolDrillModal .modal-header .btn-close{
  filter:invert(1);
  opacity:.92;
  margin-left:2px;
  box-shadow:none;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width:768px){
  #schoolDrillModal .modal-header{
    flex-wrap:wrap;
    align-items:flex-start;
  }

  #schoolDrillModal .modal-head-main{
    flex:1 1 100%;
    order:1;
  }

  #schoolDrillModal .modal-tools{
    order:2;
    margin-left:0;
  }

  #schoolDrillModal .modal-header .btn-close{
    order:3;
    margin-left:auto;
  }
}
.drill-tabs-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.drill-tabs-left{
  min-width:0;
  flex:1;
}

.drill-gender-summary{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-left:auto;
}

.drill-gender-summary .gender-pill{
  min-height:32px;
  padding:0 12px;
  font-size:12px;
  font-weight:800;
}

@media (max-width:768px){
  .drill-tabs-row{
    flex-direction:column;
    align-items:stretch;
  }

  .drill-gender-summary{
    width:100%;
    justify-content:flex-start;
    margin-left:0;
  }
}