/* Skop Portal – new design layer.
 * Everything is scoped to html.skp-on (set by skin.js), so without the script the portal looks exactly as before. */

/* ---------- base: Heebo, full width, room for the side menu ---------- */
html.skp-on #skop-portal {
  --f-display: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --f-body: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --skp-side: 272px;
  position: relative;
  min-height: 100vh;
}
html.skp-on #skop-portal :is(h1, h2, h3, .hb-sec-h) {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.01em;
}
html.skp-on #skop-portal .sp-display {
  font-family: var(--f-display);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.08;
}
.skp-top-anchor { position: absolute; top: 0; }

/* ---------- side menu ---------- */
.skp-side {
  position: fixed;
  top: var(--wp-admin--admin-bar--height, 0px);
  right: 0;
  bottom: 0;
  width: var(--skp-side, 272px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: #0A111B;
  color: #B9C5D6;
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  direction: rtl;
  text-align: right;
  scrollbar-width: thin;
  scrollbar-color: #1E2B3D transparent;
  box-sizing: border-box;
}
.skp-side *, .skp-side *::before, .skp-side *::after { box-sizing: border-box; }
.skp-side a { text-decoration: none; }
.skp-side a:focus-visible, .skp-side button:focus-visible { outline: 2px solid #7FB0FF; outline-offset: 2px; }

.skp-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 20px 20px 14px;
  color: #FFFFFF;
}
.skp-mark { flex: none; order: -1; }
.skp-brand-t { display: flex; flex-direction: column; line-height: 1.15; }
.skp-word { font-family: "Montserrat", "Arial Black", system-ui, sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 0.01em; color: #FFFFFF; direction: ltr; text-align: right; }
.skp-word b { color: #7FB0FF; font-weight: 800; }
.skp-sub { font-size: 12px; color: #8494AB; font-weight: 600; margin-top: 4px; }

.skp-client {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 14px 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background-color: #0E1927;
  border: 1px solid #1E2B3D;
}
.skp-client b { display: block; color: #FFFFFF; font-size: 15.5px; line-height: 1.3; }
.skp-client small { display: block; color: #8494AB; font-size: 12.5px; }
.skp-av {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background-color: #F4EEE6; color: #6B4E2E;
  font-weight: 900; font-size: 18px;
}

.skp-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 14px 4px; }
.skp-quick a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 8px;
  border-radius: 10px;
  font-weight: 700; font-size: 14px;
  white-space: nowrap;
}
.skp-quick a.p { background-color: #2A5BE6; color: #FFFFFF; }
.skp-quick a.p:hover { background-color: #1E47C8; color: #FFFFFF; }
.skp-quick a.s { background-color: rgba(127, 176, 255, 0.14); color: #DFE7F3; }
.skp-quick a.s:hover { background-color: rgba(127, 176, 255, 0.22); color: #FFFFFF; }

.skp-nav { display: flex; flex-direction: column; gap: 1px; padding: 0 10px 12px; }
.skp-g { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; color: #8494AB; margin: 16px 12px 6px; }
.skp-a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  color: #B9C5D6;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.skp-a svg { flex: none; }
.skp-a span { flex: 1; min-width: 0; }
.skp-a:hover { background-color: rgba(255, 255, 255, 0.05); color: #FFFFFF; }
.skp-a.on { background-color: rgba(42, 91, 230, 0.26); color: #FFFFFF; font-weight: 600; box-shadow: inset -3px 0 0 #7FB0FF; }
.skp-a.on svg { stroke: #7FB0FF; }
.skp-a.hl { background-color: #2A5BE6; color: #FFFFFF; font-weight: 700; }
.skp-a.hl.on { box-shadow: inset -3px 0 0 #FFFFFF; }
.skp-a.hl svg { stroke: #FFFFFF; }

.skp-foot {
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(185, 197, 214, 0.12);
  display: flex; flex-direction: column; gap: 8px;
}
.skp-row { display: flex; gap: 6px; }
.skp-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #1E2B3D;
  background: transparent;
  color: #B9C5D6;
  font: 500 14px "Heebo", system-ui, sans-serif;
  cursor: pointer;
}
.skp-btn:hover { color: #FFFFFF; border-color: #2E3C52; }
.skp-ver { font-size: 12px; color: #6B7A90; text-align: center; }
.skp-ver:hover { color: #B9C5D6; }

.skp-burger {
  display: none;
  place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 10px;
  border: 1px solid var(--bar-line, #1d2836);
  background: transparent;
  color: var(--bar-ink, #ffffff);
  cursor: pointer;
}
.skp-backdrop { display: none; }

/* ---------- desktop: menu on the side, content beside it ---------- */
@media (min-width: 1001px) {
  html.skp-on #skop-portal { padding-right: var(--skp-side); }

  /* the old top bar becomes a light, slim bar; its links live in the menu now */
  html.skp-on #skop-portal .sp-top {
    --bar-bg: var(--bg);
    --bar-ink: var(--ink);
    --bar-ink-2: var(--muted);
    --bar-line: var(--line);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    -webkit-backdrop-filter: saturate(1.2) blur(8px);
    backdrop-filter: saturate(1.2) blur(8px);
    border-bottom: 1px solid var(--line);
  }
  html.skp-on #skop-portal .sp-top .sp-logo,
  html.skp-on #skop-portal .sp-top .sp-sep,
  html.skp-on #skop-portal .sp-nav { display: none; }
  html.skp-on #skop-portal .sp-top .sp-who { font-weight: 800; font-size: 17px; color: var(--ink); }

  html.skp-on #skop-portal .sp-wrap { max-width: 1240px; padding-inline: 32px; }

  /* control-center hero: a rounded card inside the content area */
  html.skp-on #skop-portal .hb-hero { margin: 22px 32px 0; border-radius: 24px; }
  html.skp-on #skop-portal .hb-hero > .sp-wrap { padding-inline: 30px; }
}

/* ---------- management strip ---------- */
html.skp-on #skop-portal .sp-adminbar {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-bottom: 1px solid var(--line);
}
html.skp-on #skop-portal .sp-adminbar a { color: var(--accent-text); font-weight: 700; }

/* ---------- client report: navy opening card ---------- */
html.skp-on #skop-portal .sp-hero {
  --bg: #0a111b;
  --surface: #111a27;
  --surface-2: #182334;
  --ink: #eef2f8;
  --ink-2: #b3bccb;
  --muted: #8792a4;
  --line: #1f2b3d;
  --line-strong: #2e3c52;
  --accent: #4d8dff;
  --accent-ink: #06101f;
  --accent-soft: #132a52;
  --accent-text: #8db5ff;
  --good: #3fc23f;
  --good-soft: #123018;
  --warn-soft: #33270f;
  --warn-ink: #f0b74a;
  --bad: #ff8a86;
  --grid: #1c2738;
  --axis: #33425a;
  color-scheme: dark;
  color: var(--ink);
  margin-top: 24px;
  padding: 28px 30px 30px;
  border-radius: 24px;
  background-color: #0A111B;
  background-image:
    radial-gradient(640px 280px at 15% 0%, rgba(42, 91, 230, 0.42), transparent 70%),
    linear-gradient(rgba(185, 197, 214, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185, 197, 214, 0.06) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
}
html.skp-on #skop-portal .sp-hero .sp-display { color: #FFFFFF; }
html.skp-on #skop-portal .sp-hero .sp-kpi {
  padding: 18px 20px;
  border-radius: 16px;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(185, 197, 214, 0.14);
}

/* ---------- report sections become cards ---------- */
html.skp-on #skop-portal .sp-view > .sp-block:not(.sp-rq-zone):not(.sp-so-zone):not(.sp-cm-zone) {
  margin-top: 22px;
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
html.skp-on #skop-portal .sp-view > .sp-block:not(.sp-rq-zone):not(.sp-so-zone):not(.sp-cm-zone) .sp-card {
  background: var(--surface-2);
  background: color-mix(in srgb, var(--surface-2) 38%, var(--surface));
  border-color: transparent;
}
html.skp-on #skop-portal .sp-view > .sp-block.sp-rq-zone,
html.skp-on #skop-portal .sp-view > .sp-block.sp-so-zone,
html.skp-on #skop-portal .sp-view > .sp-block.sp-cm-zone { margin-top: 22px; border-radius: 20px; }
html.skp-on #skop-portal .sp-view > .sp-block:last-child { margin-bottom: 36px; }
html.skp-on #skop-portal .hb-card { border-radius: 20px; }

/* ---------- phones and small tablets: the menu is a drawer ---------- */
@media (max-width: 1000px) {
  .skp-side {
    width: min(86vw, 300px);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    visibility: hidden;
  }
  html.skp-open .skp-side { transform: none; visibility: visible; box-shadow: -24px 0 60px rgba(0, 0, 0, 0.35); }
  .skp-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(10, 17, 27, 0.45); }
  html.skp-open .skp-backdrop { display: block; }
  html.skp-open, html.skp-open body { overflow: hidden; }
  html.skp-on .skp-burger { display: inline-grid; }
  html.skp-on #skop-portal .sp-hero { padding: 22px 18px 24px; border-radius: 20px; }
  html.skp-on #skop-portal .sp-view > .sp-block:not(.sp-rq-zone):not(.sp-so-zone):not(.sp-cm-zone) { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .skp-side, .skp-a { transition: none; }
}

@media print {
  .skp-side, .skp-backdrop, .skp-burger { display: none !important; }
  html.skp-on #skop-portal { padding-right: 0 !important; }
}

/* ---------- login, code and password screens: no side menu ---------- */
html.skp-bare .skp-side,
html.skp-bare .skp-backdrop,
html.skp-bare .skp-burger { display: none !important; }
@media (min-width: 1001px) {
  html.skp-on.skp-bare #skop-portal { padding-right: 0; }
}
