/* ==========================================================================
   PA Connect – Full Consolidated Styles (pa-connect-full.css)
   Responsive below desktop; MAX 5 columns on large screens (centered, no stretch)
   ========================================================================== */

/* ===================== 0) TOKENS & BASE ===================== */
:root{
  --pa-navy:#003D73;
  --pa-green:#77c043;
  --bg:#F6F8FB;
  --panel:#FFFFFF;
  --ink:#0F172A;
  --line:#E2E8F0;
  --shadow-sm:0 2px 8px rgba(0,44,84,.06);
  --shadow-md:0 12px 40px rgba(0,44,84,.12);
  --icon-bg:#EEF4FA;
  --icon-border:#D8E4F2;

  /* layout tokens */
  --container-pad-x: 24px;
  --container-pad-y: 24px;
  --tile-h: 116px;
  --radius: 12px;

  /* grid tokens */
  --gap: 20px;         /* spacing between tiles */
  --col-min: 220px;    /* min tile width for wrap behavior on small screens */
  --col-desktop: 280px;/* ideal tile width on desktop (used to cap container) */

  /* sticky helpers */
  --header-h: 56px;                /* sticky header min-height */
  --csb-top: calc(var(--header-h) + 8px);

  /* touch tokens (used in mobile hardening) */
  --tap: 44px;     /* min finger target */
  --gap-sm: 10px;  /* compact gap */
}

/* Meticula font (matches your preload path) */
@font-face{
  font-family: "Meticula";
  src: url("/static/assets/fonts/Meticula.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Base */
*,*::before,*::after{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-weight: 600;
}

.hidden{ visibility:hidden !important; }
.hidden-perm{ display:none !important; } /* never shown if not allowed */

/* ===================== 1) HEADER ===================== */
/* Sticky, seamless top bar */
.header{
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in oklab, var(--bg) 92%, white);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
  backdrop-filter: saturate(120%) blur(3px);
}
.header.scrolled{ border-bottom-color: var(--line); }

/* Bar layout */
.header-inner{
  max-width: 100vw; width: 100%; margin: 0;
  padding: 12px var(--container-pad-x);
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px;
  min-height: 56px;
}

/* Left: logo */
.logo{ display:flex; align-items:center; gap:10px; min-height:32px; }
.logo img{ height: 32px; width:auto; display:block; }

/* Right cluster: bell + user name + company + avatar */
.header-actions{
  position: relative; /* anchor for dropdowns */
  display: flex; align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* User info */
.user-info{
  display:flex; align-items:center; gap:.6rem;
  color:#495057; font-size:1rem; font-weight:700;
  white-space: nowrap;
}
.user-info .company-name{
  color:#475569; font-weight:700; font-size:.95rem; letter-spacing:.2px;
}

/* Avatar (button version used in HTML) */
.user-avatar,
.user-avatar#userBtn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--pa-green);
  color: #fff;

  /* Use Meticula, NOT bold */
  font-family: Meticula, Inter, system-ui, sans-serif;
  font-weight: 400;        /* normal */
  font-size: .9rem;        /* slightly clearer for Meticula */

  border: 0;
  cursor: pointer;
}

.user-avatar#userBtn:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--pa-green) 40%, white);
  outline-offset: 2px;
}


/* Company button */
.company-name#companyBtn{
  display:inline-flex; align-items:center; gap:.35rem;
  background:transparent; border:0; font:inherit; color:#475569;
  font-weight:700; cursor:pointer; padding:2px 6px; border-radius:8px;
}
.company-name#companyBtn:hover{ background:#eef2f7; }
.company-name#companyBtn:focus-visible{
  outline:2px solid color-mix(in oklab, var(--pa-navy) 30%, white);
  outline-offset:2px;
}
.company-name#companyBtn i{ font-size:13px; line-height:1; }

/* ===================== 1a) HEADER BELL ===================== */
.header-bell{
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  transition: transform .12s ease;
  cursor: pointer;
}
.header-bell:hover,
.header-bell:focus,
.header-bell:active{
  background: transparent;
  box-shadow: none;
  transform: none;
}

/* Icon wrapper */
.header-bell .icon{
  display: grid;
  place-items: center;
  width: 16px; height: 16px; line-height: 1;
}

/* Bell color */
.header-bell .icon i,
.header-bell .icon i::before{
  color: var(--pa-navy) !important;
  -webkit-text-fill-color: var(--pa-navy) !important;
  font-size: 18px;
  line-height: 1;
}

/* Numeric badge */
.header-bell .bell-badge{
  position: absolute !important;
  top: -4px;
  right: -4px;
  width: auto;
  height: 18px;
  min-width: 18px;
  padding: 0 6px;
  font: 800 11px/18px Meticula, Inter, system-ui, sans-serif;
  color: #fff;
  background: var(--pa-green);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(119,192,67,.35);
  clip: auto;
  overflow: visible;
  white-space: nowrap;
}

/* (Legacy unread dot off) */
.header-bell.has-unread::after{ display:none !important; }

/* ===================== 1b) HEADER DROPDOWNS ===================== */
.notif-menu{
  position:absolute; right:0; top:calc(100% + 8px);
  width:min(460px, 92vw);
  background:#fff; border:1px solid #e2e8f0; border-radius:12px;
  box-shadow:0 16px 48px rgba(2,6,23,.14);
  overflow:hidden;
  opacity:0; transform: translateY(-6px) scale(.98);
  pointer-events:none;
  transition: opacity .16s ease, transform .16s ease;
  z-index:1200;
}
.notif-menu.show{ opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }

.notif-head{
  padding:10px 12px;
  font:900 14px/1.2 Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:#0f172a; background:#f8fafc; border-bottom:1px solid #eef2f7;
}
.notif-list{
  max-height:360px; overflow:auto; list-style:none; margin:0; padding:6px;
}
.notif-empty{ padding:18px 14px; color:#64748b; font-weight:600; }

.notif-item{
  display:grid; grid-template-columns:auto 1fr auto;
  align-items:center; gap:10px; padding:8px;
  border-radius:10px; cursor:pointer; transition:background .12s ease;
}
.notif-item:hover{ background:#f2f6fb; }
.notif-item .ni-icon{
  width:36px; height:36px; display:grid; place-items:center;
  border-radius:10px; background:var(--icon-bg); border:1px solid var(--icon-border); color:var(--pa-navy);
}
.notif-item .ni-icon i{ font-size:18px; }
.ni-title{ min-width:0; }
.ni-title h4{
  margin:0; font:800 14px/1.2 Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:#0f172a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ni-title .ni-sub{
  margin:2px 0 0; color:#64748b; font-weight:600; font-size:12px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* Right-hand count chips green */
.ni-count{
  min-width:26px; height:22px; padding:0 8px; border-radius:999px;
  background: var(--pa-green) !important; color:#fff !important;
  font:800 12px/22px Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  text-align:center; box-shadow: 0 2px 6px rgba(119,192,67,.35);
}

.notif-item.action-danger:hover{ background:#fef2f2; }
.notif-item .is-current{ background:#e8f0fb; border-color:#d6e2f7; }

.notif-foot{
  padding:8px; border-top:1px solid #eef2f7; display:flex; justify-content:flex-end;
}
.notif-foot .link-btn{
  appearance:none; border:0; background:transparent; color:#0f172a;
  font:800 12px/1 Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  padding:8px 10px; border-radius:8px; cursor:pointer;
}
.notif-foot .link-btn:hover{ background:#f2f6fb; }

/* ===================== 2) PAGE WRAPPER ===================== */
.page{
  max-width: 100vw; width: 100%; margin:0;
  padding: var(--container-pad-y) var(--container-pad-x) calc(var(--container-pad-y) + env(safe-area-inset-bottom));
  position: relative; z-index: 0;
}

/* Type-to-search HUD + footer credit */
.search-hud{
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  background: #0f172a; color: #fff;
  padding: 6px 10px; border-radius: 999px;
  font-size: .9rem; letter-spacing:.2px; font-weight: 800;
  display:none; gap:8px; align-items:center;
  box-shadow: 0 8px 24px rgba(2,6,23,.2);
  z-index: 1200; opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
.search-hud.show{ display:flex; opacity: 1; }
.badge{ background: rgba(120,120,128,.24); padding: 2px 8px; border-radius: 999px; font-size:.8rem; font-weight:800; }

.powered-by-floating{
  position: fixed; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 1100; font-size: .7rem; color: #334155; letter-spacing: .2px; font-weight: 600; opacity: .85;
  pointer-events: none; user-select: none; text-align: center; white-space: nowrap;
}
.search-hud.show ~ .powered-by-floating{ bottom: calc(48px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce){
  .module-card, .module-card::before, .header{ transition: none; }
}

/* ===================== 3) MODULES GRID & TILES ===================== */
.modules-grid{
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(var(--col-min), 1fr));
  align-items: stretch;
  margin-top: 30px;
  width: 100%;
}
@media (min-width: 1200px){
  .page .modules-grid{
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    max-width: calc(var(--col-desktop) * 5 + var(--gap) * 4) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

.module-card{
  position: relative; background: var(--panel);
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s, border-color .22s, background .22s;
  cursor: pointer; overflow: hidden;
  height: auto; min-height: var(--tile-h);
  display:flex; align-items:center; justify-content:center; padding: 8px 10px; will-change: transform;
}
.module-inner{
  width:100%; height:100%;
  display:flex; flex-direction:row; align-items:center; justify-content:flex-start;
  gap: 12px; padding: 10px 12px;
}
.module-card::before{
  content:""; position:absolute; top:0; left:0; right:0; height:3px; background: var(--pa-green);
  transform: scaleX(0); transform-origin:left; transition: transform .22s ease;
}
.module-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in oklab, var(--pa-green) 55%, transparent); }
.module-card:hover::before{ transform: scaleX(1); }
.module-card:focus-visible{ outline: 2px solid color-mix(in oklab, var(--pa-green) 80%, white); outline-offset: 2px; }

.module-icon{
  width: 48px; height: 48px;
  flex: 0 0 auto; border-radius: 10px;
  display:flex; align-items:center; justify-content:center;
  background: var(--icon-bg); border: 1px solid var(--icon-border); color: var(--pa-navy);
  transition: border-color .2s ease, background .2s ease; font-weight: 800; overflow: hidden;
}
.module-icon i{ display:inline-block; font-size: 22px; line-height:1; }
.module-card:hover .module-icon{ border-color: var(--pa-green); }

.module-text{ gap: 3px; }
.module-title{
  margin: 4px 0 0;
  color:var(--pa-navy);
  font-size: 1.1rem;
  font-weight: 900; letter-spacing:-.2px; line-height:1.25;
  white-space:normal; word-break:break-word;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.module-desc{
  margin: 0; color: #6d7b90;
  font-weight: 400; font-size: .75rem; line-height: 1.2;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* Tile badge + actions */
.module-card { position: relative; }
.module-badge{
  position: absolute; top: 8px; right: 8px;
  min-width: 1.25rem; height: 1.25rem; padding: 0 6px;
  border-radius: 999px; display: inline-flex; align-items:center; justify-content:center;
  font: 800 0.75rem/1 Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #fff; background: var(--pa-green);
  box-shadow: 0 6px 18px rgba(119,192,67,.35); transform: translateY(-2px);
}
.module-card .module-actions{
  position: absolute; right: 8px; bottom: 8px;
  display: flex; gap: 6px; opacity: 0; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease; pointer-events: none;
}
.module-card:hover .module-actions,
.module-card:focus-within .module-actions{
  opacity: 1; transform: translateY(0); pointer-events: auto;
}

/* Chips (generic) */
.chip{
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #0f172a;
  padding: 3px 8px;
  border-radius: 8px;
  font: 700 .75rem/1 Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  display: inline-flex; gap: 6px; align-items: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.chip:hover{ background:#e8eef6; border-color:#d2dbea; }
.chip:active{ transform: translateY(1px); }
.chip i{ font-size: 14px; line-height: 1; }

/* Pinned state */
.module-card[data-pinned="true"]{
  border-color: color-mix(in oklab, var(--pa-green) 60%, white);
  box-shadow: 0 8px 28px rgba(0,44,84,.08), inset 0 0 0 1px color-mix(in oklab, var(--pa-green) 55%, transparent);
}
.module-card[data-pinned="true"] .chip.pin{
  background: #e8f6e8; border-color: #cfeac9; color: #14532d;
}

/* ===================== 4) LOGIN PAGE ===================== */
body.login-page {
  display:flex; align-items:center; justify-content:center;
  min-height:100vh; background: var(--bg);
  position: relative; overflow: hidden;
}
.login-container {
  background: var(--panel); border:1px solid color-mix(in oklab, var(--pa-navy) 12%, var(--line));
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  padding:48px 40px; width:100%; max-width:400px; text-align:center;
  backdrop-filter: saturate(115%) blur(0px);
}
.login-logo img { height:48px; width:auto; margin-bottom:24px; }
.login-title { font:900 1.4rem/1.2 Meticula, Inter, system-ui; color:var(--pa-navy); margin-bottom:12px; }
.login-sub { color:#64748b; font-weight:500; font-size:.9rem; margin-bottom:32px; }
.login-form { display:flex; flex-direction:column; gap:16px; }
.login-form input{
  padding:12px 14px; border:1px solid var(--line); border-radius:8px;
  font:600 1rem/1 Meticula, Inter, system-ui; color:var(--ink); background:#fff;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.login-form input:focus{
  outline:none; border-color:var(--pa-green);
  box-shadow:0 0 0 3px color-mix(in oklab, var(--pa-green) 30%, transparent);
}
.login-btn{
  background:var(--pa-green); color:#fff; border:none; border-radius:8px;
  font:800 1rem/1 Meticula, Inter, system-ui; padding:12px; cursor:pointer;
  transition:background .15s ease, transform .1s ease;
}
.login-btn:hover { background:color-mix(in oklab, var(--pa-green) 85%, black); }
.login-btn:active { transform:translateY(1px); }
.login-footer{ margin-top:24px; font-size:.85rem; color:#64748b; }
.login-footer a{ color:var(--pa-navy); font-weight:700; text-decoration:none; }
.login-footer a:hover{ text-decoration:underline; }
@media (max-width:480px){ .login-container{padding:32px 24px;} }

/* Login eye toggle */
.password-wrap{ position: relative; display: flex; align-items: center; }
.password-wrap input{ width: 100%; padding-right: 42px; }
.password-wrap button{
  position: absolute; right: 10px; background: none; border: 0; color: #64748b;
  cursor: pointer; display: inline-grid; place-items: center; height: 100%; padding: 0;
  transition: color .2s ease, transform .1s ease;
}
.password-wrap button:hover{ color: var(--pa-navy); transform: scale(1.08); }
.password-wrap button:active{ transform: scale(.96); }
.password-wrap button i{ font-size: 18px; line-height: 1; position: relative; }
.password-wrap button.showing i::after{
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 2px; height: 20px; background: currentColor; transform: rotate(45deg); border-radius: 2px; z-index: 1;
}

/* Remember row */
.login-meta{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-top:4px; margin-bottom:8px;
}
.remember{ display:inline-flex; align-items:center; gap:8px; font-size:.9rem; color:#475569; user-select:none; }
.remember input[type="checkbox"]{ width:16px; height:16px; margin:0; accent-color: var(--pa-green); }
.forgot-link{
  color: var(--pa-navy); font-weight:800; text-decoration:none; font-size:.9rem;
}
.forgot-link:hover{ text-decoration:underline; }
.forgot-link:focus-visible{
  outline:2px solid color-mix(in oklab, var(--pa-navy) 35%, white);
  outline-offset:2px; border-radius:4px;
}
@media (max-width: 420px){
  .login-meta{ flex-direction:column; align-items:stretch; gap:10px; }
  .forgot-link{ align-self:flex-end; }
}

/* Login background ribbons + grain */
body.login-page::before{
  content:""; position: fixed; inset: -25vmax; z-index: -2; pointer-events: none;
  background:
    conic-gradient(from 200deg at 20% 30%, color-mix(in oklab, var(--pa-navy) 18%, transparent) 0 20%, transparent 25% 100%),
    conic-gradient(from -30deg at 80% 20%, color-mix(in oklab, var(--pa-green) 20%, transparent) 0 18%, transparent 25% 100%),
    radial-gradient(60vmax 40vmax at 50% 120%, rgba(0,0,0,.05), transparent 60%);
  transform: rotate(-8deg) scale(1.1); filter: blur(20px) saturate(110%); opacity: .85;
}
body.login-page::after{
  content:""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in oklab, white 70%, var(--bg)) 10%, transparent 60%);
  opacity: .75;
}
.login-page .grain{
  content:""; position: fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    repeating-linear-gradient(0deg, rgba(2,6,23,.015) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(2,6,23,.015) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply; opacity:.45;
}
@supports (mask-image: radial-gradient(#000, transparent)){
  .login-page .grain{ mask-image: radial-gradient(90vmax 75vmax at 50% 50%, #000 60%, transparent 95%); }
}


/* Module action chips: safe defaults that won't break anything else */
.header .header-inner{display:flex;align-items:center}
.header .module-actions{
  display:flex !important;
  align-items:center;
  gap:.5rem;
  margin-left:.75rem;
  flex-wrap:wrap;
}
.header .module-actions .chip{
  height:32px;
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:0 .75rem;
  border-radius:9999px;
  font-weight:700;
  border:0;
  background:#eceff3;
  line-height:32px;
  cursor:pointer;
}
.header .module-actions .chip.primary{background:#2fbf71;color:#fff}
.header .module-actions .chip i{font-size:16px}


/* --- Header three-part flex: [logo] [module-actions] [header-actions] --- */
.header .header-inner{
  display:flex !important;
  align-items:center;
  justify-content:flex-start !important; /* override any space-between */
  gap:0;
}

.header .logo{
  order:0;
  flex:0 0 auto;            /* don't grow/shrink */
}

/* the chips go *immediately* after logo (JS already inserts them there) */
.header .module-actions{
  order:1;
  display:flex;
  align-items:center;
  gap:.5rem;
  margin-left:.75rem;
  flex:1 1 auto;            /* can shrink if space is tight */
  min-width:0;              /* allow flexbox to actually shrink this area */
  overflow:hidden;          /* prevent overlap into the right buttons */
}

.header .header-actions{
  order:2;
  margin-left:auto;         /* push to the far right */
  display:flex;
  align-items:center;
  gap:.5rem;
  flex:0 0 auto;            /* fixed width, no shrink */
}

/* chip basics (keeps them readable and on one line) */
.header .module-actions .chip{
  white-space:nowrap;
  height:32px;
  display:inline-flex; align-items:center; gap:.45rem;
  padding:0 .75rem; border-radius:999px; font-weight:700; border:0;
  background:#eceff3; line-height:32px; cursor:pointer;
}
.header .module-actions .chip.primary{
  background:var(--pa-green,#77c043); color:#fff; box-shadow:0 2px 4px rgba(0,0,0,.08);
}
.header .module-actions .chip i{ font-size:16px; }

/* Optional: when space gets tight, let the chips scroll horizontally instead of crashing into the right */
@media (max-width: 980px){
  .header .module-actions{
    overflow-x:auto;
    scrollbar-width:none;
  }
  .header .module-actions::-webkit-scrollbar{ display:none; }
}

/* =========================
   Header text links next to logo
   ========================= */
.header .header-inner{display:flex;align-items:center;justify-content:flex-start;gap:0}
.header .logo{
  flex:0 0 auto;
  position:relative; display:flex; align-items:center; gap:10px;
  transition:padding-left .15s ease;
}
.header .logo-link img{
  height:32px; width:auto; display:block; transition:transform .15s ease;
}
/* gentle nudge on hover */
.header .logo:hover{ padding-left:26px }
.header .logo:hover .logo-link img{ transform:translateX(2px) }

/* actions slot just after logo */
.header .module-actions{
  display:flex; align-items:center; gap:12px;
  margin-left:.75rem; flex:0 0 auto; min-width:0;
}
.header .header-actions{ margin-left:auto; display:flex; align-items:center; gap:.5rem }

/* plain text header links (anchor + button look identical) */
.header .module-actions .header-link{
  appearance:none; background:transparent; border:0;
  padding:4px 8px; border-radius:8px;
  color:var(--ink,#003D73);
  font:600 .95rem/1 Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing:.2px; display:inline-flex; align-items:center;
  cursor:pointer; text-decoration:none;
  transition:background .15s ease, color .15s ease;
}
.header .module-actions .header-link:hover{ background:#eef2f7; text-decoration:none }
.header .module-actions .header-link:active{ background:#e8edf5 }
.header .module-actions .header-link:focus-visible{
  outline:2px solid color-mix(in oklab, var(--pa-navy,#003D73) 30%, white);
  outline-offset:2px; border-radius:8px;
}

/* back-to-index arrow that fades in when hovering logo */
#appHeader .logo .back-home{
  position:absolute; left:0; top:50%; transform:translateY(-50%);
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:6px;
  color:#003D73; text-decoration:none;
  font:700 16px/1 Meticula, Inter, system-ui;
  opacity:0; pointer-events:none;
  transition:opacity .15s ease, background .15s ease;
}
#appHeader .logo:hover .back-home{ opacity:1; pointer-events:auto }
#appHeader .logo .back-home:hover{ background:#eef2f7 }
#appHeader .logo .back-home:active{ background:#e8edf5 }
#appHeader .logo .back-home:focus-visible{
  outline:2px solid color-mix(in oklab, var(--pa-navy,#003D73) 30%, white);
  outline-offset:2px;
}

/* dropdown used by the Configuration link */
.header-config-menu{
  position:absolute; z-index:4000; min-width:220px;
  background:#fff; border:1px solid var(--line,#e2e8f0);
  border-radius:12px; box-shadow:0 12px 40px rgba(0,44,84,.12);
  padding:6px; display:none;
}
.header-config-menu.show{ display:block }
.header-config-menu .button.btn--menu{
  display:flex; align-items:center; gap:.5rem;
  padding:.5rem .75rem; border-radius:10px; text-decoration:none;
  color:#003D73; background:transparent; border:0;
  font:600 .95rem/1 Meticula, Inter, system-ui; letter-spacing:.2px;
}
.header-config-menu .button.btn--menu:hover{ background:#f5f8fc }

/* =========================
   Mobile bottom tab bar (Notifications / Company / Profile)
   ========================= */
:root{ --tabbar-h: 56px; }

/* hide right-side header actions on mobile */
@media (max-width: 768px){
  #appHeader .header-actions{ display:none !important; }
}

/* fixed bottom bar container */
.pa-mobile-tabbar{
  position: fixed; left:0; right:0; bottom:0;
  height: var(--tabbar-h);
  background:#fff;
  border-top:1px solid var(--line, #E2E8F0);
  box-shadow:0 -8px 24px rgba(2,6,23,.06);
  display:none;
  z-index:1100;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 768px){
  .pa-mobile-tabbar{ display:grid; }
}
.pa-mobile-tabbar .tabs{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  align-items:stretch;
  height: calc(var(--tabbar-h) - env(safe-area-inset-bottom));
}
.pa-mobile-tabbar button{
  appearance:none; background:transparent; border:0; margin:0;
  font:700 12px/1 Meticula, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:#0F172A;
  display:grid; align-content:center; justify-items:center; gap:4px;
  cursor:pointer;
}
.pa-mobile-tabbar .icon{
  position:relative; display:grid; place-items:center;
  width:22px; height:22px; line-height:1;
  color:var(--pa-navy, #003D73);
  font-size:18px;
}
.pa-mobile-tabbar .label{ font-weight:800; letter-spacing:.2px }

/* bell badge on mobile tab */
.pa-mobile-tabbar .badge{
  position:absolute; top:-6px; right:-10px;
  min-width:16px; height:16px; padding:0 5px;
  border-radius:999px; background:var(--pa-green, #77c043); color:#fff;
  font:800 10px/16px Meticula, Inter, system-ui;
  box-shadow:0 2px 6px rgba(119,192,67,.35);
  display:none;
}
.pa-mobile-tabbar .badge.show{ display:inline-flex; align-items:center; justify-content:center }

/* reposition dropdown menus on mobile so they pop above the tab bar */
@media (max-width: 768px){
  .notif-menu{
    position: fixed !important;
    left: 50% !important; transform: translate(-50%,0) !important;
    right: auto !important; top: auto !important;
    bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom)) !important;
    width: min(480px, 94vw) !important;
  }
  .notif-menu.show{ opacity:1 !important; transform: translate(-50%,0) !important; }
}

/* ensure page content isn’t hidden behind tab bar on mobile */
@media (max-width: 768px){
  .page{
    padding-bottom: calc(var(--container-pad-y, 24px) + var(--tabbar-h) + 12px + env(safe-area-inset-bottom)) !important;
  }
}
html, body{
  height:100%;
}

#pa-app-root{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}



/* =========================================================
   FORMS BUILDER – WIDE TWO-COLUMN LAYOUT
   Only affects pages where <body class="forms-page">
   ========================================================= */

body.forms-page .page{
  /* center the content and give it a nice max width */
  max-width: 1440px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: var(--container-pad-y) var(--container-pad-x)
           calc(var(--container-pad-y) + env(safe-area-inset-bottom)) !important;
}

/* Make the direct child of .page a 2-column grid:
   left = form details, right = questions builder */
body.forms-page .page > *{
  display: grid !important;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr) !important;
  align-items: flex-start;
  gap: 28px !important;
}

/* Make any “card” inside fill its column nicely */
body.forms-page .page > * > *{
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
