/* App-specific additions on top of the ERP Connect theme. Tokens only. */

/* level palette: diverging ordinal, validated (dataviz) - blue arm = above standard, gray = Proficient, red arm = below */
:root {
  --lv-expplus: #104281;
  --lv-expert: #2a78d6;
  --lv-advanced: #86b6ef;
  --lv-proficient: #c9c8c3;
  --lv-intermediate: #f09a8a;
  --lv-beginner: #e34948;
  --lv-belowpar: #a61e1e;
  --lv-na: #E2E8F0;
}

.lv { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: var(--radius-pill);
  font-size: .7rem; font-weight: 700; color: #fff; white-space: nowrap; }
.lv-expplus { background: var(--lv-expplus); }
.lv-expert { background: var(--lv-expert); }
.lv-advanced { background: var(--lv-advanced); color: var(--ink); }
.lv-proficient { background: var(--lv-proficient); color: var(--ink); }
.lv-intermediate { background: var(--lv-intermediate); color: var(--ink); }
.lv-beginner { background: var(--lv-beginner); }
.lv-belowpar { background: var(--lv-belowpar); }
.lv-na { background: var(--lv-na); color: var(--ink-2); }

/* theme.css: the standalone-item rule outranks .active and paints white-on-white */
.sidebar-menu > ul > li:not(.sidebar-section) > .sidebar-link.active { color: var(--cc-red-darker); }

.card-x { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-x > .hd { padding: .7rem 1rem; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: .5rem; }
.card-x > .hd .t { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.card-x > .bd { padding: 1rem; }

/* 9-box */
.nb-wrap { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: 1fr 22px; gap: 4px; }
.nb-ylab { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--mut); }
.nb-xlab { grid-column: 2; text-align: center; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); }
.nb-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, minmax(78px, 1fr)); gap: 6px; }
.nb-cell { border-radius: var(--radius-sm); padding: .5rem .6rem; border: 1px solid var(--line); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; transition: transform .12s, box-shadow .12s; background: var(--surface); }
.nb-cell:hover, .nb-cell:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-h); outline: none; }
.nb-cell.sel { outline: 3px solid var(--navy); outline-offset: 1px; }
.nb-cell .n { font-family: var(--num); font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; line-height: 1; }
.nb-cell .b { font-size: .62rem; font-weight: 800; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.nb-cell .a { font-size: .68rem; color: var(--ink-3); line-height: 1.2; }
.nb-cell .me { font-size: .66rem; font-weight: 800; color: var(--navy); }
.nb-good { background: var(--pos-tint); border-color: #B7DCC2; }
.nb-mid { background: var(--accent-tint); border-color: #BFE3EC; }
.nb-watch { background: #FFF7ED; border-color: #F6D8B0; }
.nb-bad { background: var(--neg-tint); border-color: #F0C4C4; }

.role-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.role-tab { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: var(--radius-pill);
  padding: .25rem .8rem; font-size: .78rem; font-weight: 700; cursor: pointer; }
.role-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.role-tab .cnt { font-family: var(--num); opacity: .75; margin-left: .3rem; font-weight: 600; }

.tip { border-bottom: 1px dotted var(--mut); cursor: help; }
.formula { font-family: var(--num); font-size: .72rem; }

.thr-input { width: 70px; }
.thr-input.form-control-sm { padding: .15rem .3rem; text-align: right; font-family: var(--num); }

.swot { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.swot > div { border-radius: var(--radius-sm); padding: .6rem .75rem; border: 1px solid var(--line); }
.swot h6 { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .35rem; }
.swot ul { margin: 0; padding-left: 1rem; font-size: .8rem; }
.swot .s { background: var(--pos-tint); } .swot .w { background: var(--neg-tint); }
.swot .o { background: var(--accent-tint); } .swot .t { background: #FFF7ED; }

.ai-badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .65rem; font-weight: 800; color: var(--purple);
  background: #F3EEFF; border-radius: var(--radius-pill); padding: .1rem .45rem; text-transform: uppercase; letter-spacing: .05em; }
.btn-ai { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-ai:hover, .btn-ai:focus { background: #6D28D9; border-color: #6D28D9; color: #fff; }

.map-table select { min-width: 220px; }
.stat-mini { font-family: var(--num); font-weight: 800; font-size: 1.1rem; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 1000; background: var(--navy); color: #fff; padding: .4rem .8rem; }
.skip-link:focus { left: 8px; top: 8px; }

@media (max-width: 575px) {
  .swot { grid-template-columns: 1fr; }
  .nb-grid { grid-template-rows: repeat(3, minmax(64px, 1fr)); }
}

@media print {
  .no-print, .bottom-nav, .pwa-toast { display: none !important; }
  .card-x { box-shadow: none; break-inside: avoid; }
  .main-content { margin-left: 0 !important; }
  .banner, .profile-cover { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =====================================================================
   v1.1 — visual refresh: banners, avatars, rings, mobile app shell, PWA
   ===================================================================== */
body {
  background:
    radial-gradient(1200px 380px at 70% -120px, rgba(14,116,144,.07), transparent 70%),
    var(--app-bg);
}

@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fadeUp .32s ease both; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---- banner (page hero) ---- */
.banner {
  position: relative; overflow: hidden; border-radius: 18px; color: #fff;
  background:
    radial-gradient(520px 260px at 88% 10%, rgba(94,196,216,.35), transparent 60%),
    radial-gradient(420px 220px at 0% 110%, rgba(244,0,9,.28), transparent 60%),
    linear-gradient(120deg, #0F2A52 0%, #173763 45%, #0B5A71 100%);
  box-shadow: 0 10px 30px -12px rgba(15,42,82,.55);
  padding: 1.35rem 1.5rem; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 1rem; min-height: 132px;
}
.banner::before {
  content: ""; position: absolute; inset: 0; opacity: .12; pointer-events: none;
  background-image: radial-gradient(#fff 1px, transparent 1.2px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 80%);
  mask-image: linear-gradient(90deg, transparent 30%, #000 80%);
}
.banner-body { position: relative; flex: 1; min-width: 0; z-index: 1; }
.banner-eyebrow { font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
.banner-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: .15rem 0 .35rem; line-height: 1.15; color: #fff; }
.banner-sub { font-size: .84rem; opacity: .88; display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
.banner-sub .bi { opacity: .8; margin-right: .25rem; }
.banner-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.banner-img { position: relative; z-index: 1; width: 230px; max-width: 34%; height: auto; flex-shrink: 0;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.25)); }
.banner.lg { min-height: 210px; padding: 1.6rem 1.8rem; }
.banner.lg .banner-title { font-size: 1.9rem; }
.banner.lg .banner-img { width: 400px; max-width: 42%; margin: -.6rem -.4rem -1rem 0; }
.banner-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.banner-stat { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 12px;
  padding: .45rem .75rem; min-width: 96px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.banner-stat .v { font-family: var(--num); font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.banner-stat .l { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 700; }
.btn-glass { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); color: #fff; font-weight: 600; }
.btn-glass:hover, .btn-glass:focus { background: rgba(255,255,255,.26); color: #fff; border-color: rgba(255,255,255,.5); }
.btn-glass:disabled { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.2); }

/* ---- avatar ---- */
.avatar { --av: var(--accent); width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800;
  font-size: .8rem; letter-spacing: .02em; background: var(--av);
  background-image: linear-gradient(135deg, rgba(255,255,255,.18), rgba(0,0,0,.18));
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(15,42,82,.18); user-select: none; }
.avatar.sm { width: 28px; height: 28px; font-size: .66rem; }
.avatar.xl { width: 88px; height: 88px; font-size: 1.9rem; box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(15,42,82,.25); }
.emp-cell { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.emp-cell .nm { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-cell .cd { font-family: var(--num); font-size: .68rem; color: var(--mut); }

/* ---- score ring ---- */
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .ring-v { font-family: var(--num); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.ring .ring-l { font-size: .56rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--mut); margin-top: .2rem; }
@media (prefers-reduced-motion: no-preference) { .ring circle.arc { transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); } }

/* ---- profile (Employee 360) ---- */
.profile { position: relative; overflow: hidden; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.profile-cover { height: 118px; position: relative;
  background:
    radial-gradient(360px 160px at 85% 0%, rgba(94,196,216,.45), transparent 60%),
    radial-gradient(300px 160px at 10% 120%, rgba(244,0,9,.35), transparent 60%),
    linear-gradient(120deg, #0F2A52, #0B5A71); }
.profile-cover::after { content: ""; position: absolute; inset: 0; opacity: .14;
  background-image: radial-gradient(#fff 1px, transparent 1.2px); background-size: 16px 16px; }
.profile-cover img { position: absolute; right: 14px; bottom: -6px; height: 124px; z-index: 1; }
.profile-main { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; padding: .9rem 1.4rem 1.1rem; position: relative; z-index: 2; }
/* only the avatar overlaps the cover — the name must sit on white */
.profile-main > .avatar.xl { margin-top: -58px; align-self: flex-start; }
.profile-id { flex: 1 1 260px; min-width: 0; }
.profile-id h1 { font-size: 1.45rem; font-weight: 800; color: var(--navy); margin: 0 0 .3rem; letter-spacing: -.02em; }
.profile-meta { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; font-size: .8rem; color: var(--mut); }
.profile-rings { display: flex; gap: 1.1rem; align-items: center; }
.profile-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding: .9rem 1.4rem 1.1rem; border-top: 1px solid var(--line-soft); }

/* ---- leaderboard ---- */
.lb-row { display: flex; align-items: center; gap: .65rem; padding: .5rem .35rem; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; border-radius: 10px; }
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover, .lb-row:focus-visible { background: var(--bg); outline: none; }
.lb-rank { width: 20px; text-align: center; font-family: var(--num); font-weight: 800; color: var(--mut); font-size: .76rem; flex-shrink: 0; }
.lb-bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin-top: .3rem; }
.lb-bar > span { display: block; height: 100%; border-radius: 3px; }

/* ---- empty state with illustration ---- */
.empty-illus { text-align: center; padding: 2rem 1rem; color: var(--mut); }
.empty-illus img { width: 200px; max-width: 70%; margin-bottom: .75rem; }
.empty-illus .t { font-weight: 700; color: var(--ink-2); }

/* ---- mobile list cards (replace wide tables on phones) ---- */
.m-list { display: flex; flex-direction: column; gap: .55rem; }
.m-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .8rem;
  box-shadow: var(--shadow); display: flex; gap: .7rem; align-items: center; cursor: pointer; width: 100%; text-align: left; }
.m-card:active { transform: scale(.99); }
.m-card .grow { flex: 1; min-width: 0; }
.m-card .ttl { font-weight: 700; font-size: .88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card .sub { font-size: .72rem; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card .val { text-align: right; flex-shrink: 0; }
.m-card .val .n { font-family: var(--num); font-weight: 800; font-size: 1rem; color: var(--navy); }
.kpi-mrow { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; padding: .65rem .1rem; border-bottom: 1px solid var(--line-soft); align-items: center; }
.kpi-mrow:last-child { border-bottom: 0; }
.kpi-mrow .nm { font-size: .84rem; font-weight: 600; color: var(--ink); }
.kpi-mrow .meta { font-size: .7rem; color: var(--mut); }
.kpi-mrow .sc { font-family: var(--num); font-weight: 800; text-align: right; font-size: .95rem; }
.kra-mhead { display: flex; justify-content: space-between; align-items: center; background: var(--accent-tint);
  border-left: 3px solid var(--accent); border-radius: 8px; padding: .45rem .6rem; margin: .8rem 0 .2rem; font-size: .76rem; font-weight: 700; color: var(--accent-700); }
.kra-mhead:first-child { margin-top: 0; }

/* ---- bottom navigation (phones) ---- */
.bottom-nav { display: none; }
@media (max-width: 768px) {
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    background: rgba(255,255,255,.97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(15,42,82,.08); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: .15rem; background: none; border: 0;
    color: var(--mut); text-decoration: none; font-size: .62rem; font-weight: 700; padding: .35rem 0; border-radius: 12px; min-height: 48px; justify-content: center; }
  .bottom-nav .bi { font-size: 1.2rem; line-height: 1; }
  .bottom-nav .active { color: var(--cc-red); }
  .bottom-nav .active .bi::before { transform: translateY(-1px); }
  .main-content > main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .main-content > footer { display: none; }
  .top-bar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
}

/* ---- install / update toasts ---- */
.pwa-toast { position: fixed; z-index: 1080; left: 50%; transform: translateX(-50%); bottom: 1rem; width: min(560px, calc(100% - 1.5rem));
  background: var(--ink); color: #fff; border-radius: 14px; padding: .7rem .85rem; display: flex; align-items: center; gap: .75rem;
  box-shadow: 0 16px 40px rgba(15,23,42,.35); font-size: .84rem; }
.pwa-toast img { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }
.pwa-toast .grow { flex: 1; min-width: 0; }
.pwa-toast .ttl { font-weight: 700; }
.pwa-toast .sub { font-size: .72rem; opacity: .75; }
@media (max-width: 768px) { .pwa-toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.topbar-install { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border-radius: var(--radius-pill);
  background: var(--cc-red); color: #fff; border: 0; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.topbar-install:hover { background: var(--cc-red-dark); }

/* ---- 9-box v2 ---- */
.nb2 { display: grid; grid-template-columns: 22px 46px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 6px; row-gap: 6px; }
.nb2-ytitle { grid-row: 1; grid-column: 1; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; gap: .3rem;
  font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--navy);
  background: linear-gradient(0deg, var(--bg-2), var(--accent-tint)); border-radius: 999px; }
.nb2-ytitle .bi { transform: rotate(90deg); }
.nb2-ylabels { grid-row: 1; grid-column: 2; display: grid; grid-template-rows: repeat(3, 1fr); gap: 8px; }
.nb2-ylabels > div, .nb2-xlabels > div { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; text-align: center; }
.nb2-ylabels b, .nb2-xlabels b { font-size: .7rem; color: var(--ink-2); }
.nb2-ylabels small, .nb2-xlabels small { font-size: .6rem; color: var(--mut); font-family: var(--num); }
.nb2-grid { grid-row: 1; grid-column: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(96px, auto); gap: 8px; }
.nb2-xlabels { grid-row: 2; grid-column: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nb2-xtitle { grid-row: 3; grid-column: 3; display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .2rem;
  font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--navy);
  background: linear-gradient(90deg, var(--bg-2), var(--accent-tint)); border-radius: 999px; }

.nb2-cell { --tc: var(--accent); --tb: #BFE3EC; --g1: #F2FAFD; --g2: #DCEFF6;
  position: relative; text-align: left; border: 1px solid var(--tb); border-radius: 14px; padding: .6rem .65rem .55rem;
  background: linear-gradient(145deg, var(--g1), var(--g2)); display: flex; flex-direction: column; gap: .3rem; min-width: 0;
  cursor: pointer; overflow: visible; transition: transform .18s ease, box-shadow .18s ease, opacity .2s, filter .2s; }
.nb2-cell::after { content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  background: radial-gradient(120px 60px at 100% 0%, rgba(255,255,255,.7), transparent 70%); }
.nb2-cell:hover, .nb2-cell:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(15,42,82,.45); outline: none; }
.nb2-cell.t-good  { --tc: #15803D; --tb: #A7DDB8; --g1: #F1FBF4; --g2: #D6F1DF; }
.nb2-cell.t-mid   { --tc: #0E7490; --tb: #A9D8E6; --g1: #F1F9FC; --g2: #D8EDF5; }
.nb2-cell.t-watch { --tc: #B45309; --tb: #F1CE98; --g1: #FFF9F0; --g2: #FCEBD2; }
.nb2-cell.t-bad   { --tc: #B91C1C; --tb: #EDB8B8; --g1: #FFF5F5; --g2: #FADCDC; }
.nb2-cell.sel { outline: 3px solid var(--navy); outline-offset: 2px; }
.nb2-cell.dim { opacity: .72; filter: saturate(.8); }
.nb2-head { display: flex; align-items: center; justify-content: space-between; }
.nb2-icon { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tc); color: #fff; font-size: .85rem; box-shadow: 0 4px 10px -4px var(--tc); }
.nb2-no { font-family: var(--num); font-weight: 800; font-size: .7rem; color: var(--tc); background: rgba(255,255,255,.75);
  border: 1px solid var(--tb); border-radius: 999px; padding: .05rem .45rem; }
.nb2-action { font-size: .74rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.nb2-count { margin-top: auto; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: .35rem; }
.nb2-count .n { font-family: var(--num); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.nb2-count .pc { font-family: var(--num); font-size: .66rem; font-weight: 700; color: var(--tc); justify-self: end; }
.nb2-count .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.8); overflow: hidden; margin-top: .3rem; }
.nb2-count .bar > span { display: block; height: 100%; border-radius: 3px; background: var(--tc); }

/* "You are here": lifted cell + marching-ants border + pulsing pin */
.nb2-cell.here { transform: scale(1.04); z-index: 2; box-shadow: 0 16px 32px -14px rgba(244,0,9,.55), 0 0 0 4px rgba(244,0,9,.10);
  border-color: transparent; }
.nb2-cell.here:hover { transform: scale(1.05); }
.nb2-ants { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); overflow: visible; pointer-events: none; z-index: 1; }
.nb2-ants rect { fill: none; stroke-width: 3; }
.nb2-ants .base { stroke: #fff; }
.nb2-ants .march { stroke: var(--cc-red); stroke-dasharray: 9 6; stroke-linecap: round; animation: nb2-ants 0.7s linear infinite; }
@keyframes nb2-ants { to { stroke-dashoffset: -15; } }
.nb2-pin { position: relative; align-self: flex-start; display: inline-flex; align-items: center; gap: .3rem; margin-top: auto;
  background: var(--cc-red); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .02em;
  padding: .22rem .6rem .22rem .5rem; border-radius: 999px; box-shadow: 0 6px 14px -6px rgba(244,0,9,.8); z-index: 2; }
.nb2-pin .ping { position: absolute; left: .45rem; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: rgba(255,255,255,.7); animation: nb2-ping 1.6s cubic-bezier(0,0,.2,1) infinite; }
@keyframes nb2-ping { 0% { transform: scale(.6); opacity: .9; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
.nb2-pin .bi { position: relative; animation: nb2-bob 1.6s ease-in-out infinite; }
@keyframes nb2-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
/* The marching ants run even with "reduce motion" on — the owner wants the marker always moving (small, non-flashing).
   erp-theme.css globally forces `animation-duration:.01ms !important` under prefers-reduced-motion, which freezes
   the "You are here" marker; re-assert its animations with higher specificity + !important so they keep running. */
@media (prefers-reduced-motion: reduce) {
  .nb2-ants .march { animation: nb2-ants 0.7s linear infinite !important; }
  .nb2-pin .ping   { animation: nb2-ping 1.6s cubic-bezier(0,0,.2,1) infinite !important; }
  .nb2-pin .bi     { animation: nb2-bob 1.6s ease-in-out infinite !important; }
}
@media (max-width: 575px) {
  .nb2 { grid-template-columns: 16px 34px minmax(0, 1fr); column-gap: 4px; }
  .nb2-grid, .nb2-xlabels, .nb2-ylabels { gap: 6px; }
  .nb2-grid { grid-auto-rows: minmax(84px, auto); }
  .nb2-cell { padding: .45rem .45rem .45rem; border-radius: 12px; }
  .nb2-icon { width: 22px; height: 22px; font-size: .7rem; border-radius: 7px; }
  .nb2-action { font-size: .62rem; }
  .nb2-count .n { font-size: 1.05rem; }
  .nb2-pin { font-size: .58rem; padding: .18rem .45rem; }
  .nb2-ylabels small, .nb2-xlabels small { display: none; }
}

/* ---- employee self-service shell ---- */
.self-shell { min-height: 100vh; min-height: 100dvh; background: var(--app-bg); }
.self-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: .7rem;
  padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem; color: #fff;
  background: linear-gradient(120deg, #FF1F1F, var(--cc-red) 45%, var(--cc-red-darker)); box-shadow: 0 6px 18px -10px rgba(139,0,0,.6); }
.self-logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.45); }
.self-title { font-weight: 800; font-size: 1rem; line-height: 1.1; }
.self-sub { font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.self-main { padding: 1rem .75rem calc(1.5rem + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; }

/* ---- auth (login / change password) ---- */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--app-bg); }
.auth-page.single { grid-template-columns: 1fr; }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 2.2rem 2.6rem; display: flex; flex-direction: column;
  background:
    radial-gradient(520px 320px at 90% 0%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(0,0,0,.28), transparent 60%),
    linear-gradient(135deg, #FF1F1F 0%, var(--cc-red) 40%, var(--cc-red-darker) 100%); }
.auth-brand::before { content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: radial-gradient(#fff 1px, transparent 1.3px); background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(160deg, #000, transparent 70%); mask-image: linear-gradient(160deg, #000, transparent 70%); }
.auth-brand-top { display: flex; align-items: center; gap: .8rem; position: relative; z-index: 1; }
.auth-logo { width: 48px; height: 48px; border-radius: 13px; box-shadow: 0 0 0 2px rgba(255,255,255,.5), 0 8px 18px rgba(0,0,0,.25); }
.auth-brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.auth-brand-org { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; opacity: .85; font-weight: 700; }
.auth-brand-mid { position: relative; z-index: 1; margin-top: auto; }
.auth-brand-mid h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 0 0 1rem; color: #fff; }
.auth-brand-mid h1 span { color: #FFE3A3; }
.auth-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.auth-tags span { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: .35rem .8rem;
  font-size: .78rem; font-weight: 600; display: inline-flex; gap: .4rem; align-items: center; }
.auth-hero { position: relative; z-index: 1; width: min(520px, 100%); align-self: center; margin: 1.5rem 0 -1rem; filter: drop-shadow(0 18px 24px rgba(0,0,0,.28)); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 2rem 1.8rem;
  box-shadow: 0 24px 60px -24px rgba(15,42,82,.35); }
.auth-card-logo { width: 56px; height: 56px; border-radius: 15px; box-shadow: 0 10px 22px rgba(244,0,9,.3); margin-bottom: 1rem; }
.auth-card h2 { font-size: 1.45rem; font-weight: 800; color: var(--navy); margin: 0; letter-spacing: -.02em; }
.auth-sub { color: var(--mut); font-size: .88rem; margin: .25rem 0 1.25rem; }
.auth-field { display: block; margin-bottom: .85rem; }
.auth-field > span { display: block; font-size: .72rem; font-weight: 700; color: var(--ink-3); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .06em; }
.auth-input { display: flex; align-items: center; gap: .55rem; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 0 .8rem; background: var(--bg);
  transition: border-color .15s, box-shadow .15s, background .15s; }
.auth-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(14,116,144,.14); background: #fff; }
.auth-input > .bi { color: var(--mut); }
.auth-input input { flex: 1; border: 0; outline: 0; background: transparent; padding: .72rem 0; font-size: .95rem; min-width: 0; color: var(--ink); }
.auth-eye { border: 0; background: none; color: var(--mut); padding: .3rem; }
.auth-submit { padding: .7rem; font-size: .95rem; font-weight: 700; border-radius: 12px; margin-top: .4rem; box-shadow: 0 10px 20px -8px rgba(244,0,9,.55); }
.auth-alert { display: flex; gap: .5rem; align-items: flex-start; background: var(--neg-tint); color: var(--neg); border: 1px solid #F0C4C4;
  border-radius: 10px; padding: .6rem .75rem; font-size: .84rem; margin-bottom: 1rem; }
.auth-hint { margin-top: 1rem; font-size: .78rem; background: var(--warn-tint, #FFF7ED); color: #92400E; border: 1px dashed #F6C77A; border-radius: 10px; padding: .55rem .7rem; }
.auth-foot { margin-top: 1.1rem; text-align: center; font-size: .72rem; color: var(--mut-2); }
.auth-badge { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  background: var(--accent-tint); color: var(--accent); margin-bottom: 1rem; }
@media (max-width: 900px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-brand { padding: 1.4rem 1.3rem 4.5rem; min-height: 0; }
  .auth-brand-mid { margin-top: 1.4rem; }
  .auth-brand-mid h1 { font-size: 1.6rem; margin-bottom: .7rem; }
  .auth-tags span { font-size: .7rem; padding: .25rem .6rem; }
  .auth-hero { position: absolute; right: -40px; bottom: -10px; width: 230px; opacity: .3; margin: 0; }
  .auth-main { margin-top: -3.2rem; align-items: flex-start; padding: 0 1rem 2rem; position: relative; z-index: 2; }
  .auth-card { padding: 1.5rem 1.25rem; }
  .auth-card-logo { display: none; }
}

.btn-primary:disabled, .btn-primary.disabled { background-color: var(--cc-red); border-color: var(--cc-red); color: #fff; opacity: .5; }

/* ---- user menu ---- */
.user-btn { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: .15rem .55rem .15rem .15rem; font-size: .76rem; font-weight: 700; color: var(--ink-2); }
.user-btn:hover { border-color: var(--line-2); background: var(--bg); }
.user-menu { min-width: 240px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-h); padding: .4rem; }
.user-menu .hdr { display: flex; gap: .6rem; align-items: center; padding: .5rem .5rem .7rem; border-bottom: 1px solid var(--line-soft); margin-bottom: .3rem; }
.user-menu .dropdown-item { border-radius: 8px; font-size: .84rem; padding: .45rem .6rem; }

/* ---- phone tuning ---- */
@media (max-width: 575px) {
  .main-content > main { padding-left: .75rem; padding-right: .75rem; }
  .banner { padding: 1.1rem; min-height: 0; border-radius: 16px; }
  .banner-title { font-size: 1.25rem; }
  .banner.lg { min-height: 0; padding: 1.2rem 1.1rem; }
  .banner.lg .banner-title { font-size: 1.4rem; }
  .banner-img { display: none; }
  .banner.lg .banner-img { display: block; position: absolute; right: -40px; top: -6px; width: 200px; max-width: none; opacity: .22; margin: 0; }
  .banner-stat { min-width: 0; flex: 1 1 40%; }
  .kpi .kpi-body { padding: .8rem .85rem .9rem; }
  .kpi .kpi-value { font-size: 1.3rem; }
  .kpi-icon { width: 32px; height: 32px; margin-bottom: .45rem; }
  .card-x > .bd { padding: .8rem; }
  .card-x > .hd { flex-wrap: wrap; }
  .profile-main { padding: .6rem 1rem 1rem; }
  .profile-main > .avatar.xl { margin-top: -52px; }
  .profile-id { flex-basis: 100%; }
  .profile-cover img { height: 92px; opacity: .45; }
  .profile-rings { width: 100%; justify-content: space-around; }
  .profile-actions { padding: .8rem 1rem 1rem; }
  .profile-actions .btn { flex: 1 1 auto; }
  .nb-cell { padding: .4rem; }
  .nb-cell .a { font-size: .58rem; }
  .nb-cell .n { font-size: 1.1rem; }
  .nb-wrap { grid-template-columns: 18px 1fr; }
  .nb-xlab span { display: none; }
  .role-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .role-tabs::-webkit-scrollbar { display: none; }
  .role-tab { flex-shrink: 0; }
  .chip-strip { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chip-strip::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .page-head-title { font-size: 1.1rem; }
}

/* ===== Web Forms specifics (CompetencyConnect) ===== */
body > form { display: flex; min-height: 100vh; }           /* server form wraps the shell */
.self-shell body > form, form.self-form { display: block; } /* self-service page is a plain column */
.cc-link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; }
