/* ============================================================================
   Monaqasa polish layer
   Loaded AFTER page.css and mon.css, so it refines the measured skin without
   touching it (survives a data/skin regeneration). Everything is scoped to
   #ppa-app so it never reaches the real Monaqasa Header/Footer.
   Goal: same page, but wearing the main site's colours, Cairo type, dropdowns,
   spacing and a modern, premium motion pass — responsive at every width.
   ========================================================================== */

/* ---- Type: Cairo everywhere, like monaqasa.org (Arabic included) ---------- */
#ppa-app,
#ppa-app *:not(svg):not(path) {
  font-family: "Cairo", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Dropdowns: the Monaqasa select -------------------------------------- *
   White control, soft 1.5px border, a cyan drop-triangle (the same mark the
   main site's react-select uses), cyan on hover and a soft cyan focus ring.   */
#ppa-app select,
#ppa-app .mq-pick {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='10'%20height='6'%20viewBox='0%200%2010%206'%3E%3Cpath%20d='M0%200l5%206%205-6z'%20fill='%230c9fc1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
  padding-left: 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  color: #1e3a5f;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
[dir="rtl"] #ppa-app select,
[dir="rtl"] #ppa-app .mq-pick {
  background-position: left 14px center;
  padding-right: 14px;
  padding-left: 34px;
}
#ppa-app select:hover,
#ppa-app .mq-pick:hover {
  border-color: #0c9fc1;
}
#ppa-app select:focus,
#ppa-app .mq-pick:focus {
  outline: none;
  border-color: #0c9fc1;
  box-shadow: 0 0 0 3px rgba(12, 159, 193, 0.15);
}
#ppa-app select::-ms-expand {
  display: none;
}
/* the big "choose a body" picker reads as a proper field */
#ppa-app .mq-pick {
  height: 40px;
  font-size: 13px;
}
/* search / sort fields pick up the same focus ring as the selects */
#ppa-app .tctl input,
#ppa-app .tctl select {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
#ppa-app .tctl input:hover,
#ppa-app .tctl select:hover {
  border-color: #0c9fc1;
}
#ppa-app .tctl input:focus,
#ppa-app .tctl select:focus {
  outline: none;
  border-color: #0c9fc1;
  box-shadow: 0 0 0 3px rgba(12, 159, 193, 0.15);
}

/* ---- Spacing: a little more air between items, like the main site -------- */
#ppa-app .mq-areas,
#ppa-app .mq-admgrid,
#ppa-app .mq-stats {
  gap: 18px;
}
#ppa-app .mq-panel {
  padding: 22px 26px 26px;
}
#ppa-app .sec-h {
  margin: 32px 0 16px;
}

/* ---- Modern "wow": premium motion + gradient calls-to-action ------------- */
#ppa-app .mqcard,
#ppa-app .mqadm,
#ppa-app .portal-card,
#ppa-app .mcard,
#ppa-app .bodycard,
#ppa-app .step,
#ppa-app .idea {
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
#ppa-app .mqcard:hover,
#ppa-app .mqadm:hover,
#ppa-app .portal-card:hover,
#ppa-app .mcard:hover,
#ppa-app .bodycard:hover,
#ppa-app .idea:hover {
  transform: translateY(-3px);
}
/* primary CTAs carry the main-site cyan gradient */
#ppa-app .mqcard .mc-cta,
#ppa-app .mqadm .ma-cta,
#ppa-app .hero .cta button,
#ppa-app .pathbar .nx {
  background-image: linear-gradient(135deg, #0c9fc1 0%, #57b0c6 100%);
  border: 0;
  transition: filter 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
#ppa-app .mqcard:hover .mc-cta,
#ppa-app .mqadm:hover .ma-cta {
  filter: brightness(1.05);
  box-shadow: 0 8px 20px rgba(12, 159, 193, 0.26);
}
/* "Full report": quiet by default, carrying the cyan only on hover. Stays
   pushed to the end of the tab row via the margin-auto it inherits. */
#ppa-app .mq-report {
  margin-inline-start: auto;
  background: #fff;
  background-image: none;
  color: #0c9fc1;
  border: 1px solid #cfe8ee;
  box-shadow: none;
  transition: color 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
#ppa-app .mq-report:hover {
  background-image: linear-gradient(135deg, #0c9fc1 0%, #57b0c6 100%);
  color: #fff;
  border-color: transparent;
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(12, 159, 193, 0.26);
}
/* the active in-page tab: a touch bolder motion on the underline */
#ppa-app .mq-tab,
#ppa-app .mq-chip {
  transition: color 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease;
}
/* keyboard focus visible on interactive bits, in the brand cyan */
#ppa-app button:focus-visible,
#ppa-app a:focus-visible {
  outline: 2px solid #0c9fc1;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---- Responsiveness: fill the gaps between the skin's breakpoints -------- */
@media (max-width: 1024px) {
  #ppa-app .mq-areas,
  #ppa-app .mq-admgrid,
  #ppa-app .mq-stats {
    gap: 14px;
  }
}
@media (max-width: 680px) {
  #ppa-app .mq-panel {
    padding: 18px 16px 20px;
  }
  /* comfortable tap targets for the selects/fields on phones */
  #ppa-app .mq-pick,
  #ppa-app .tctl select,
  #ppa-app .tctl input {
    height: 42px;
    font-size: 14px;
  }
  #ppa-app .tctl {
    gap: 8px;
  }
  #ppa-app .tctl input[type="search"] {
    min-width: 0;
    flex: 1 1 100%;
  }
}

/* ============================================================================
   Refinement pass — remove the dead space the eye reads as "gaps", and retire
   the hollow icon box on the detail KPIs. Scoped to #ppa-app, appended last so
   it refines the measured skin without editing it.
   ========================================================================== */

/* ---- Hero stat strip ("The register in figures"): balance the tile --------
   The icon + number sat on the left of a wide tile, leaving the right half
   empty — most obvious on phones where each tile runs the full width. Centre
   the icon/number group so the tile reads as a deliberate, filled stat rather
   than content dumped on one side. */
#ppa-app .mq-stat {
  justify-content: center;
  gap: 13px;
}
#ppa-app .mq-stat .sb {
  flex: none;
}
@media (max-width: 560px) {
  #ppa-app .mq-stat {
    padding: 18px 16px;
    gap: 16px;
  }
}

/* ---- Detail-page KPI tiles: drop the empty box, add the brand accent bar ---
   The skin drew a 42px tinted square before each KPI with nothing inside it,
   so it read as a missing icon and pushed the number off-centre with dead
   space to its side. Lay the tile out as a clean value-over-label stack and
   mark it with the same slim cyan accent bar the section headings use, tinted
   per KPI colour. */
#ppa-app .kpi {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 0;
  padding: 14px 16px 14px 18px;
  position: relative;
  overflow: hidden;
}
[dir="rtl"] #ppa-app .kpi {
  padding: 14px 18px 14px 16px;
}
#ppa-app .kpi::before {
  content: "";
  position: absolute;
  inset-block: 13px;
  inset-inline-start: 0;
  width: 3px;
  height: auto;
  border-radius: 0 3px 3px 0;
  background: var(--kc2, #0c9fc1);
}
[dir="rtl"] #ppa-app .kpi::before {
  border-radius: 3px 0 0 3px;
}
/* keep the number as the hero, label quietly beneath it */
#ppa-app .kpi .val {
  line-height: 1.2;
}
#ppa-app .kpi .lbl {
  order: 2;
}

/* ---- Facts side panel: clean colored figures (gauge cleanup in PASS 3) ---- */
#ppa-app .fact {
  align-items: center;
}

/* ---- Portal / group cards: align the footer link across a row ------------- */
#ppa-app .portal-card .pc-go,
#ppa-app .mqcard .mc-cta,
#ppa-app .mqadm .ma-cta {
  margin-top: auto;
}

/* ============================================================================
   PASS 2 — the palette, the breathing room, and the tables.
   The dashboard shipped with a loud default palette (royal blue, bright orange,
   a harsh #c62828 red) and tight, scroll-trapped tables. This block pulls every
   data colour onto monaqasa.org's own values, opens up the spacing the eye read
   as cramped, and makes the tables flow with the page. All #ppa-app–scoped and
   appended last, so no measured rule is edited.
   ========================================================================== */

/* ---- 1. Brand palette --------------------------------------------------------
   The charts, KPIs, tags and pills all resolve their colour through these CSS
   variables, so redefining them on the app root re-skins every visual at once.
   Values are the site's real tokens: cyan #0c9fc1, navy #1e3a5f, green #16a34a,
   amber #f59e0b, red #ef4444 (the soft red from the tender status chips — the
   old #c62828 was what read as "too red"), plus two blues and a slate to keep
   eight series distinguishable without leaving the cool brand family. */
#ppa-app {
  --s1: #0c9fc1; /* brand cyan   */
  --s2: #1e3a5f; /* navy         */
  --s3: #16a34a; /* green        */
  --s4: #f59e0b; /* amber        */
  --s5: #8b5cf6; /* violet       */
  --s6: #0a7f9c; /* deep teal    */
  --s7: #64748b; /* slate        */
  --s8: #ef4444; /* red (soft)   */
  --st-crit: #ef4444;
  --st-warn: #d97706;
  --st-good: #16a34a;
  --ok: #16a34a;
  --bad: #ef4444;
  /* diverging "up" (over / breach) ramp, all on the soft red */
  --up1: #fdecec;
  --up2: #f6bcbc;
  --up3: #f27272;
  --up4: #ef4444;
  /* diverging "down" ramp pulled from royal blue onto the brand cyan/navy */
  --dn1: #e8f4f8;
  --dn2: #bfe3ee;
  --dn3: #4fbcd6;
  --dn4: #0c9fc1;
}
/* KPI accent bar + value share the series colour (mon.css hard-coded the old
   loud values for the numbered variants — realign them to the palette). */
#ppa-app .kpi.c1 { --kc2: var(--s1); }
#ppa-app .kpi.c2 { --kc2: var(--s2); }
#ppa-app .kpi.c3 { --kc2: var(--s3); }
#ppa-app .kpi.c4 { --kc2: var(--s4); }
#ppa-app .kpi.c5 { --kc2: var(--s5); }
#ppa-app .kpi.c6 { --kc2: var(--s6); }
#ppa-app .kpi.c7 { --kc2: var(--s7); }
#ppa-app .kpi.c8 { --kc2: var(--s8); }
#ppa-app .kpi.crit { --kc2: #ef4444; }
#ppa-app .kpi.warn { --kc2: #d97706; }
#ppa-app .kpi.good { --kc2: #16a34a; }
#ppa-app .kpi.brand { --kc2: #0c9fc1; }
/* red flags / critical states on the soft brand red, not the dark crimson */
#ppa-app .tag.breach,
#ppa-app .pill.crit,
#ppa-app .cflag.crit {
  background: #fdecec;
  color: #ef4444;
}
#ppa-app .cflag.crit .dot { background: #ef4444; }
#ppa-app .kpi.crit .val,
#ppa-app .tag.breach { color: #ef4444; }

/* ---- 2. Tables: flow with the page, roomier rows, no inner scrollbar --------
   The 460px cap trapped the wheel inside the table and drew a scrollbar beside
   it; the list is already paginated, so let it size to its rows. Taller rows and
   a little more line-height make it read like the site's own tables. */
#ppa-app .tblwrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 14px;
  margin: 4px 0 6px;
}
#ppa-app table.dv {
  font-size: 13px;
}
#ppa-app table.dv th,
#ppa-app table.dv td {
  padding: 11px 14px;
  line-height: 1.55;
}
#ppa-app table.dv th {
  padding-top: 13px;
  padding-bottom: 13px;
  font-size: 12px;
}
/* the count/flag badges in table cells pick up the palette automatically */

/* ---- 3. Spacing: open up the blocks that read as "too close together" -------
   Section rules, table captions, the controls above a table, prose, and the
   idea / recommendation / accordion blocks all gain air between them. */
#ppa-app .sec-h {
  margin: 36px 0 18px;
}
#ppa-app .card {
  padding: 24px 26px;
  margin-bottom: 26px;
}
#ppa-app .cap {
  margin: 24px 0 12px !important;
}
#ppa-app .tctl {
  margin: 18px 0 12px;
}
#ppa-app .kpis {
  gap: 14px;
  margin: 8px 0 24px;
}
#ppa-app .note {
  margin: 16px 0;
  padding: 12px 15px;
  line-height: 1.7;
}
#ppa-app .prose p {
  margin: 0 0 14px;
}
#ppa-app .split2 {
  gap: 22px;
}
#ppa-app .chart-box {
  margin-top: 10px;
}
#ppa-app .legend {
  margin-top: 14px;
  gap: 16px 18px;
}
/* the argument / ideas, step by step */
#ppa-app .ideas {
  gap: 18px;
  margin: 22px 0 6px;
}
#ppa-app .idea {
  padding: 16px 18px;
}
#ppa-app .recs {
  gap: 14px;
  margin-top: 14px;
}
#ppa-app .rec {
  gap: 16px;
  padding: 16px 18px;
}
/* the expandable blocks on a body's page */
#ppa-app .accs {
  gap: 16px;
}
#ppa-app .acc > button {
  padding: 15px 16px;
}
#ppa-app .acc .abody {
  padding: 4px 18px 18px;
}
/* report-in-a-minute cards and guided-path steps */
#ppa-app .minute,
#ppa-app .path {
  gap: 14px;
}
#ppa-app .mini-chips,
#ppa-app .jump {
  padding: 11px 14px;
}

/* The argument boxes render as `.ideas` (not `.ideas.two`), so the skin's
   collapse rule never fired and they stayed two-up on phones, crushing the text
   to a word per line. Collapse them to one column on narrow screens. */
@media (max-width: 760px) {
  #ppa-app .ideas,
  #ppa-app .ideas.two {
    grid-template-columns: minmax(0, 1fr);
  }
  #ppa-app .idea.wide {
    grid-column: auto;
  }
}

/* ---- 4. Phone: keep the roomier rhythm, but don't overspend the width ------ */
@media (max-width: 680px) {
  #ppa-app .card {
    padding: 18px 16px;
    margin-bottom: 20px;
  }
  #ppa-app .sec-h {
    margin: 28px 0 14px;
  }
  #ppa-app table.dv th,
  #ppa-app table.dv td {
    padding: 10px 12px;
  }
}

/* ============================================================================
   PASS 3 — the "Key figures" panel.
   Each figure carried a tiny 46x46 gauge (ring / split bars / year steps). At
   that size they read as crude and, for the multi-year "steps" figure, as a
   broken L — and every one of them just restates the number printed beside it.
   Drop the gauge and present the panel as clean, colour-coded figure rows (the
   number already in its series colour, a 4px accent rail on the left), so it
   matches the KPI tiles and the rest of the site. The figures themselves are
   untouched — only the redundant decoration goes.
   ========================================================================== */
#ppa-app .facts .fx {
  display: none;
}
#ppa-app .fact {
  align-items: center;
  gap: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border-inline-start-width: 4px;
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}
#ppa-app .fact:hover {
  box-shadow: 0 6px 18px rgba(20, 50, 80, 0.08);
}
#ppa-app .fact .ft {
  flex: 1;
  min-width: 0;
}
#ppa-app .fact .fv {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--fc);
}
#ppa-app .fact .fv .usd {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
#ppa-app .fact .fl {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 3px;
}
/* a little more room between stacked figures */
#ppa-app .facts .fbody > .fact + .fact {
  margin-top: 10px;
}
/* the panel's own frame, a touch softer and roomier */
#ppa-app .facts {
  padding: 14px 14px 12px;
}
#ppa-app .facts .fh {
  margin-bottom: 12px;
}
/* on phones the figures lay out in a responsive grid (page.css) — keep the
   accent rail and spacing consistent there too */
@media (max-width: 980px) {
  #ppa-app .facts .fbody > .fact + .fact {
    margin-top: 0;
  }
}

/* ============================================================================
   PASS 4 — the article head and the jump bar.
   The eyebrow, title, stand-first and tags were stacked tight, and the "Jump
   to" pills sat right on top of one another and their label. Open the vertical
   rhythm of the header and space the jump bar out.
   ========================================================================== */
#ppa-app .card > .head {
  gap: 18px;
}
#ppa-app .card > .eyebrow {
  margin-bottom: 10px;
}
#ppa-app .card h2 {
  line-height: 1.3;
}
#ppa-app .card .stand {
  margin-top: 16px;
  padding: 14px 17px;
  line-height: 1.75;
}
#ppa-app .tags {
  margin-top: 16px;
  gap: 8px;
}
/* the heading above the argument boxes sat almost on top of them */
#ppa-app .ideas-head {
  margin: 30px 0 16px;
}
/* the jump bar: room between the label and the pills, and between pills */
#ppa-app .jump {
  gap: 10px;
  padding: 12px 15px;
}
#ppa-app .jump .jl {
  margin-inline-end: 6px;
}
#ppa-app .jump button {
  padding: 7px 15px;
}
