/* Homepage section wrapper hosting the MAT preview as a second graphic. */
.mdp-home-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  align-items: center;
}
.mdp-home-head {
  padding: 12px 0;
}
.mdp-home-h {
  font-family: var(--font-d, 'Cabinet Grotesk', sans-serif);
  font-weight: 900;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--ink);
}
.mdp-home-h .t { color: var(--teal); }
.mdp-home-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-60);
  max-width: 38ch;
  margin: 0;
}
.mdp-home-frame {
  position: relative;
}
@media (max-width: 900px) {
  .mdp-home-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 20px;
  }
  .mdp-home-sub { max-width: none; }
}

/* ─────────────────────────────────────────────────────────────
   MAT Dashboard Preview — animated POGO UI graphic for the
   "MAT & School Dashboard" solution page. Replicates the real
   Pogo Trust dashboard: dark topbar, vertical icon rail, tabs,
   5 KPI pills, map + SEND donut, schools table.
   Namespaced .mdp-* so it doesn't clash with homepage .pf-*.
   ───────────────────────────────────────────────────────────── */

.mdp-frame {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #f5f3ef;
  border: 1px solid rgba(13,26,21,0.10);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.6) inset,
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.07),
    0 24px 60px rgba(0,0,0,0.10);
  font-family: var(--font-s, Satoshi, -apple-system, system-ui, sans-serif);
  color: #1b1f1d;
  position: relative;
  isolation: isolate;
}

/* Topbar (dark teal — matches homepage preview theme) */
.mdp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #044232;
  padding: 10px 14px;
  gap: 12px;
}
.mdp-tb-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mdp-tb-logo {
  display: flex;
  gap: 2px;
}
.mdp-tb-logo .ltile {
  width: 18px; height: 18px;
  font-size: 10px;
  border-radius: 4px;
}
.mdp-tb-name {
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.95;
}
.mdp-tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mdp-tb-aibtn {
  background: linear-gradient(180deg, #0eaa82 0%, #0a8c6a 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(13,158,122,0.35);
}
.mdp-tb-bell {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.mdp-tb-user {
  background: #fff;
  padding: 3px 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.mdp-tb-user .ltile {
  width: 14px; height: 14px;
  font-size: 8px;
  border-radius: 3px;
}
.mdp-tb-avatar {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #d4cfc3;
  display: inline-block;
}

/* App body: icon rail + main */
.mdp-body {
  display: grid;
  grid-template-columns: 40px 1fr;
}

.mdp-rail {
  background: #044232;
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mdp-rail-icon {
  width: 18px; height: 18px;
  color: rgba(255,255,255,0.5);
  opacity: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.mdp-rail-icon.active { color: #0d9e7a; }
.mdp-rail-icon:hover { color: rgba(255,255,255,0.85); }
.mdp-rail-icon svg { width: 100%; height: 100%; display: block; }
.mdp-rail-div {
  width: 18px; height: 1px; background: rgba(255,255,255,0.1); margin: 2px 0;
}

/* Main content */
.mdp-main {
  padding: 14px;
  background: #f3f0ea;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 520px;
}

.mdp-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mdp-title-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #0d9e7a;
  box-shadow: 0 0 0 3px rgba(13,158,122,0.15);
}
.mdp-title {
  font-family: var(--font-d, 'Cabinet Grotesk', sans-serif);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #1b1f1d;
}

.mdp-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mdp-filter {
  background: #fff;
  border: 1px solid #e5e2dd;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 9px;
  color: #4a524d;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 88px;
}
.mdp-filter::after {
  content: '▾';
  font-size: 8px;
  color: #9a9588;
  margin-left: auto;
}
.mdp-filter.refresh {
  background: rgba(13,158,122,0.08);
  color: #0d9e7a;
  font-weight: 700;
  min-width: 0;
}
.mdp-filter.refresh::after { content: none; }

/* Tabs */
.mdp-tabs {
  display: flex;
  gap: 2px;
  background: #fff;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e5e2dd;
  align-items: center;
  font-size: 9px;
}
.mdp-tab {
  padding: 5px 8px;
  border-radius: 5px;
  color: #6a6358;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mdp-tab.active {
  background: #f0f4f3;
  color: #0d9e7a;
  font-weight: 700;
  box-shadow: 0 0 0 1px #d5e8e2;
}
.mdp-tab-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #0d9e7a;
}
.mdp-tab-info {
  margin-left: auto;
  color: #b8b3a8;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(13,158,122,0.08);
  color: #0d9e7a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
}

/* KPI cards — color-banded pills like screenshot */
.mdp-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.mdp-kpi {
  background: #fff;
  border-radius: 7px;
  border: 1px solid #e5e2dd;
  overflow: hidden;
  position: relative;
  padding: 7px 8px 9px 11px;
}
.mdp-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--kpi-color, #0d9e7a);
}
.mdp-kpi-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #8a8578;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.mdp-kpi-val {
  font-family: var(--font-d, 'Cabinet Grotesk', sans-serif);
  font-weight: 900;
  font-size: 15px;
  color: var(--kpi-color, #1b1f1d);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.mdp-kpi-sub {
  font-size: 7px;
  color: #a8a294;
  margin-top: 1px;
}

/* Middle row: map + donut */
.mdp-mid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8px;
}
.mdp-panel {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e2dd;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
}
.mdp-panel-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  color: #2d322f;
}
.mdp-panel-head .mdp-title-dot { width: 5px; height: 5px; box-shadow: 0 0 0 2px rgba(13,158,122,0.15); }
.mdp-panel-head-right {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 7.5px;
  color: #9a9588;
}
.mdp-badge-locs {
  background: rgba(232,116,42,0.12);
  color: #c4611f;
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 700;
}

/* Map panel */
.mdp-map {
  flex: 1;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 40%, rgba(186,212,170,0.45) 0%, rgba(186,212,170,0) 40%),
    radial-gradient(circle at 70% 65%, rgba(214,200,170,0.55) 0%, rgba(214,200,170,0) 50%),
    linear-gradient(120deg, #e8f1dc 0%, #ece1c7 100%);
  min-height: 140px;
}
.mdp-map::before {
  /* faint grid lines like a street map */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(0deg, rgba(255,255,255,0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.35) 1px, transparent 1px),
    linear-gradient(0deg, rgba(123,107,74,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123,107,74,0.12) 1px, transparent 1px);
  background-size: 20px 20px, 20px 20px, 60px 60px, 60px 60px;
  opacity: 0.6;
}
.mdp-map::after {
  /* wavy "roads" */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(255,255,255,0.5) 0%, transparent 18%),
    radial-gradient(ellipse at 80% 30%, rgba(255,255,255,0.5) 0%, transparent 14%);
}
.mdp-map-pin {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #0d9e7a;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25), 0 0 0 2px rgba(13,158,122,0.2);
  z-index: 2;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
}
.preview-animated .mdp-map-pin {
  animation: mdpPin 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
}
.mdp-map-pin.p2 { animation-delay: 1.3s; background: #e8742a; }
.mdp-map-pin.p3 { animation-delay: 1.4s; }
.mdp-map-pin.p4 { animation-delay: 1.5s; background: #e8742a; }
.mdp-map-pin.p5 { animation-delay: 1.6s; }
.mdp-map-pin.p6 { animation-delay: 1.7s; background: #e8742a; }
.mdp-map-pin.p1 { animation-delay: 1.2s; }

/* SEND donut panel */
.mdp-send-mid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}
.mdp-donut {
  position: relative;
  width: 96px;
  height: 96px;
}
.mdp-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mdp-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.mdp-donut-val {
  font-family: var(--font-d, 'Cabinet Grotesk', sans-serif);
  font-weight: 900;
  font-size: 14px;
  color: #1b1f1d;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: scale(0.6);
}
.mdp-donut-lbl {
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #9a9588;
  text-transform: uppercase;
  margin-top: 1px;
  opacity: 0;
}
.preview-animated .mdp-donut-val {
  animation: mdpPop 0.5s cubic-bezier(0.34,1.56,0.64,1) 1.6s forwards;
}
.preview-animated .mdp-donut-lbl {
  animation: mdpFade 0.4s ease 1.8s forwards;
}
.mdp-donut-ring {
  stroke: var(--teal, #0d9e7a);
  stroke-width: 10;
  fill: none;
  stroke-dasharray: 239;
  stroke-dashoffset: 239;
}
.preview-animated .mdp-donut-ring.pri {
  animation: mdpRing 1.2s cubic-bezier(0.25,0,0.3,1) 1.0s forwards;
}
.mdp-donut-ring.bg {
  stroke: #eee8dc;
  stroke-dashoffset: 0;
  opacity: 1;
}
.mdp-donut-ring.sec {
  stroke: #e8742a;
  stroke-dasharray: 239;
  stroke-dashoffset: 239;
}
.preview-animated .mdp-donut-ring.sec {
  animation: mdpRingSec 0.5s cubic-bezier(0.25,0,0.3,1) 1.7s forwards;
}
.mdp-legend {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 7.5px;
  color: #5a5448;
  padding-top: 4px;
  border-top: 1px solid #f0ede5;
}
.mdp-legend-dot {
  width: 5px; height: 5px; border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
}

/* Schools table */
.mdp-table {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e2dd;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mdp-table-head-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  color: #2d322f;
}
.mdp-table-sub {
  font-size: 7.5px;
  color: #9a9588;
  font-weight: 500;
  margin-left: 4px;
}
.mdp-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(7, 0.7fr);
  gap: 2px 6px;
  font-size: 8.5px;
  align-items: center;
}
.mdp-grid .hd {
  font-weight: 700;
  color: #8a8578;
  letter-spacing: 0.04em;
  font-size: 7.5px;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 1px solid #f0ede5;
}
.mdp-grid .school {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #2d322f;
}
.mdp-grid .school .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #0d9e7a;
}
.mdp-grid .school .dot.o { background: #e8742a; }
.mdp-grid .school .dot.g { background: #3a9e50; }
.mdp-grid .school .dot.b { background: #3B82F6; }
.mdp-grid .num {
  color: #4a524d;
  font-variant-numeric: tabular-nums;
}
.mdp-grid .pct-teal { color: #0d9e7a; font-weight: 700; }
.mdp-grid .pct-orange { color: #e8742a; font-weight: 700; }
.mdp-grid .bold { font-weight: 700; color: #2d322f; }
.mdp-grid .row-sep {
  grid-column: 1 / -1;
  height: 1px;
  background: #f5f2eb;
}

/* Reveal animations driven by .preview-animated on the frame */
.mdp-frame .mdp-topbar,
.mdp-frame .mdp-rail,
.mdp-frame .mdp-title-row,
.mdp-frame .mdp-filters,
.mdp-frame .mdp-tabs,
.mdp-frame .mdp-kpi,
.mdp-frame .mdp-panel,
.mdp-frame .mdp-table,
.mdp-frame .mdp-grid > * {
  opacity: 0;
  transform: translateY(8px);
}
.preview-animated .mdp-topbar { animation: mdpFadeUp 0.4s cubic-bezier(0.22,1,0.36,1) 0.05s forwards; }
.preview-animated .mdp-rail   { animation: mdpFadeUp 0.4s cubic-bezier(0.22,1,0.36,1) 0.15s forwards; }
.preview-animated .mdp-title-row { animation: mdpFadeUp 0.4s cubic-bezier(0.22,1,0.36,1) 0.25s forwards; }
.preview-animated .mdp-filters  { animation: mdpFadeUp 0.4s cubic-bezier(0.22,1,0.36,1) 0.35s forwards; }
.preview-animated .mdp-tabs     { animation: mdpFadeUp 0.4s cubic-bezier(0.22,1,0.36,1) 0.45s forwards; }
.preview-animated .mdp-kpi:nth-child(1) { animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.55s forwards; }
.preview-animated .mdp-kpi:nth-child(2) { animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.65s forwards; }
.preview-animated .mdp-kpi:nth-child(3) { animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.75s forwards; }
.preview-animated .mdp-kpi:nth-child(4) { animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.85s forwards; }
.preview-animated .mdp-kpi:nth-child(5) { animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.95s forwards; }
.preview-animated .mdp-panel.map-panel   { animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 1.05s forwards; }
.preview-animated .mdp-panel.send-panel  { animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 1.15s forwards; }
.preview-animated .mdp-table { animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 1.8s forwards; }
/* Staggered row reveal for the table cells */
.preview-animated .mdp-grid > * { animation: mdpFadeUp 0.35s cubic-bezier(0.22,1,0.36,1) forwards; }
.preview-animated .mdp-grid > *:nth-child(n+1) { animation-delay: 1.9s; }
.preview-animated .mdp-grid > *:nth-child(n+9)  { animation-delay: 2.0s; }
.preview-animated .mdp-grid > *:nth-child(n+17) { animation-delay: 2.1s; }
.preview-animated .mdp-grid > *:nth-child(n+25) { animation-delay: 2.2s; }
.preview-animated .mdp-grid > *:nth-child(n+33) { animation-delay: 2.3s; }
.preview-animated .mdp-grid > *:nth-child(n+41) { animation-delay: 2.4s; }
.preview-animated .mdp-grid > *:nth-child(n+49) { animation-delay: 2.5s; }
.preview-animated .mdp-grid > *:nth-child(n+57) { animation-delay: 2.6s; }

/* Live ticking: the attendance KPI value subtly pulses every few seconds
   so the dashboard feels alive, not frozen. */
.preview-animated .mdp-kpi.live .mdp-kpi-val {
  animation: mdpFadeUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.55s forwards,
             mdpLivePulse 6s ease-in-out 3s infinite;
}

@keyframes mdpFadeUp {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes mdpPop {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes mdpFade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes mdpPin {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes mdpRing {
  0%   { stroke-dashoffset: 239; }
  100% { stroke-dashoffset: 22; }  /* ~91% fill (matches SEND 92.9% no-sen) */
}
@keyframes mdpRingSec {
  0%   { stroke-dashoffset: 239; }
  100% { stroke-dashoffset: 222; }  /* ~7.1% fill for SEN slice */
}
@keyframes mdpLivePulse {
  0%, 100% { text-shadow: 0 0 0 rgba(13,158,122,0); }
  50%      { text-shadow: 0 0 12px rgba(13,158,122,0.35); }
}
