/* =====================================================================
   Fintos Workplace — portal styles (loads after brand.css)
   Device-adaptive by CSS only (no UA sniffing), single breakpoint 640px:
     >=641px  → DESKTOP view  (top nav, multi-column launcher)
     <=640px  → MOBILE-APP view (app header + bottom tab bar, springboard)
   ===================================================================== */

/* ===== Adaptive chrome toggle — single source of truth =====
   No !important: the chrome components (.wp-appbar/.wp-tabbar) set their own
   display:flex LATER in this file, so source order lets that win on mobile.
   (An !important here would force `revert` → the UA default `block`, which
   would stack the header/tab-bar children vertically.) */
.only-mobile{ display:none; }
.only-desktop{ display:revert; }
@media (max-width:640px){
  .only-mobile{ display:revert; }
  .only-desktop{ display:none; }
}

body.portal{ background:var(--mist); }

/* =====================================================================
   DESKTOP VIEW (>=641px is the default; mobile overrides come later)
   ===================================================================== */

/* ===== Top nav ===== */
.wp-nav{ background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:var(--z-nav); box-shadow:var(--shadow); }
.wp-nav .container{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 32px; max-width:1200px; margin:0 auto; }
.wp-nav .brand img{ height:32px; width:auto; min-width:96px; }
.wp-nav-right{ display:flex; align-items:center; gap:16px; }
.wp-user{ display:flex; align-items:center; gap:10px; padding-left:16px; border-left:1px solid var(--border); }
.wp-avatar{ width:38px; height:38px; border-radius:50%;
  background:linear-gradient(150deg,var(--amber-light),var(--deep-gold));
  color:#fff; display:grid; place-items:center; font-family:var(--font-display); font-weight:800; font-size:15px; }
.wp-user .who{ line-height:1.25; }
.wp-user .who b{ display:block; font-size:14px; color:var(--ink); font-weight:600; }
.wp-user .who span{ font-size:12px; color:var(--slate); }
/* The user block is the way into account settings — give it a hit-target feel */
a.wp-user{ text-decoration:none; border-radius:var(--r-card); padding:4px 8px 4px 16px; transition:var(--tr-fast); }
a.wp-user:hover{ background:var(--mist); }
a.wp-user:hover .who b{ color:var(--navy); }

/* btn-sm pinned height so nav buttons align */
.btn-sm{ display:inline-flex; align-items:center; justify-content:center; padding:0 14px; height:38px; font-size:13.5px; }

/* ===== Workspace shell + hero head ===== */
.wp-main{ max-width:1200px; margin:0 auto; padding:40px 32px 80px; }
.wp-hero-head{ margin-bottom:8px; }
.wp-eyebrow{ display:block; width:48px; height:4px; background:var(--gold); border-radius:var(--r-pill); margin-bottom:18px; }
.wp-hello{ margin-bottom:8px; font-family:var(--font-display); font-weight:700; color:var(--navy);
  font-size:clamp(30px,3.4vw,38px); line-height:1.1; }
.wp-sub{ color:var(--slate); font-size:16px; margin-bottom:8px; max-width:60ch; }

/* Section category headers */
.wp-section-title{ display:flex; align-items:center; gap:14px; margin:40px 0 18px;
  font-family:var(--font-display); font-weight:700; color:var(--navy); font-size:18px; }
.wp-section-title::after{ content:""; flex:1; height:1px; background:var(--border); }

/* ===== Module launcher — desktop horizontal card (left-aligned) ===== */
.mod-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
.mod-tile{ position:relative; display:flex; flex-direction:row; align-items:center; text-align:left; gap:16px;
  background:#fff; border:1px solid var(--border); border-radius:var(--r-card); padding:20px 22px; cursor:pointer;
  transition:var(--tr); box-shadow:var(--shadow); text-decoration:none; }
.mod-tile:hover{ transform:var(--lift); box-shadow:var(--shadow-lift); border-color:var(--gold); }
.mod-ico{ width:52px; height:52px; flex:none; border-radius:14px; display:grid; place-items:center; font-size:26px; }
.mod-ico.gold{ background:var(--gold-tint); }
.mod-ico.blue{ background:var(--blue-tint); }
.mod-tile .tile-text{ display:flex; flex-direction:column; min-width:0; }
.mod-tile strong{ font-size:15px; color:var(--ink); font-weight:600; }
.mod-tile small{ font-size:13px; color:var(--slate); margin-top:3px; line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.mod-tile.soon{ cursor:default; opacity:.92; }
.mod-tile.soon:hover{ transform:none; border-color:var(--border); box-shadow:var(--shadow); }
.mod-tile .soon-tag{ position:absolute; top:12px; right:12px; font-size:11px; font-weight:700; color:var(--slate);
  background:var(--mist); border-radius:var(--r-pill); padding:2px 8px; letter-spacing:.04em; }

.wp-empty{ text-align:center; color:var(--slate); padding:56px; border:1px dashed var(--border);
  border-radius:var(--r-card); background:#fff; max-width:560px; }

/* Tablet midpoints — launcher grid only, chrome stays desktop */
@media (min-width:641px) and (max-width:900px){
  .mod-grid{ grid-template-columns:repeat(2,1fr); }
  .wp-main,.wp-nav .container,.admin-shell{ padding-left:24px; padding-right:24px; }
}
@media (min-width:901px) and (max-width:1100px){
  .mod-grid{ grid-template-columns:repeat(3,1fr); }
}

/* ===== Login — desktop split (navy brand pane + white card) ===== */
.login-wrap{ min-height:100vh; min-height:100dvh; display:grid; place-items:center; padding:24px;
  background:linear-gradient(135deg,var(--navy),#2d3149); }
@media (min-width:641px){
  .login-wrap{ grid-template-columns:1fr 1fr; place-items:stretch; padding:0; }
  .login-aside{ display:flex; flex-direction:column; justify-content:center; gap:18px;
    padding:64px 72px; color:#fff; position:relative; overflow:hidden; }
  .login-aside::after{ content:""; position:absolute; right:-120px; bottom:-120px; width:360px; height:360px;
    border-radius:50%; background:radial-gradient(circle,rgba(253,186,17,.18),transparent 70%); }
  .login-aside-logo{ height:42px; width:auto; margin-bottom:8px; position:relative; z-index:1; }
  .login-aside-h{ font-family:var(--font-display); font-weight:700; color:#fff; font-size:clamp(26px,2.6vw,34px);
    line-height:1.15; max-width:14ch; position:relative; z-index:1; }
  .login-aside-p{ color:rgba(255,255,255,.82); font-size:16px; max-width:42ch; position:relative; z-index:1; }
  .login-wrap > .login-card{ align-self:center; justify-self:center; }
}
.login-card{ background:#fff; border-radius:var(--r-card); padding:40px 36px; width:100%; max-width:430px; box-shadow:var(--shadow-lift); }
.login-card .brand{ justify-content:center; width:100%; margin-bottom:18px; }
.login-card .brand img{ height:40px; width:auto; min-width:96px; }
.login-card h1{ font-family:var(--font-display); font-weight:700; font-size:26px; text-align:center; margin-bottom:4px; color:var(--navy); }
.login-card .sub{ text-align:center; color:var(--slate); font-size:14px; margin-bottom:26px; }
.login-card label{ margin-top:14px; }
.login-card .btn{ width:100%; margin-top:22px; justify-content:center; text-align:center; }
.login-foot{ text-align:center; font-size:12px; color:var(--slate); margin-top:22px; }
/* "Forgot your password?" / "Back to sign in" under a login-card action */
.login-alt{ text-align:center; margin-top:14px; }
.login-alt .linklike{ display:inline-block; padding:10px 6px; font-size:13.5px; }
.demo-box{ margin-top:22px; background:var(--mist); border:1px dashed var(--border); border-radius:var(--r-card);
  padding:14px 16px; font-size:12px; color:var(--slate); }
.demo-box b{ color:var(--navy); }
.demo-box .row{ display:flex; justify-content:space-between; gap:10px; padding:4px 0; cursor:pointer; border-radius:6px; }
.demo-box .row:hover{ color:var(--navy); background:#fff; padding-left:6px; padding-right:6px; }
.demo-box code{ font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px; }

/* ===== Back office (desktop) ===== */
.admin-shell{ max-width:1200px; margin:0 auto; padding:40px 32px 80px; }
.bo-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; margin-bottom:28px; }
.bo-head h1{ font-family:var(--font-display); font-weight:700; color:var(--navy); font-size:clamp(26px,3vw,32px); margin-top:14px; }
.bo-sub{ font-size:14px; color:var(--slate); margin-top:6px; max-width:60ch; }
/* Refresh: re-reads the active tab in place, so filters + scroll survive.
   The glyph spins while the fetch is in flight (reduced-motion is honoured
   globally by the prefers-reduced-motion block in brand.css). */
.bo-head-actions{ display:flex; gap:10px; align-items:center; margin-left:auto; }
.bo-head-actions .ref-ico{ display:inline-block; font-size:15px; line-height:1; margin-right:2px; }
.bo-head-actions .spinning .ref-ico{ animation:bo-spin .8s linear infinite; }
@keyframes bo-spin{ to{ transform:rotate(360deg); } }
.tabs{ display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:22px; flex-wrap:wrap; }
.tabs button{ border:0; background:transparent; padding:12px 18px; font-family:inherit; font-weight:600; font-size:14px;
  color:var(--slate); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; transition:var(--tr-fast); }
.tabs button:hover{ color:var(--navy); }
.tabs button.active{ color:var(--navy); border-bottom-color:var(--gold); }
/* brand.css gives every bare <section> 72px marketing padding — app panels
   and wizard steps are sections too, so neutralize it inside app shells. */
.admin-shell section,.login-card section{ padding:0; }

/* Result count + "clear filters", sits between a toolbar and its table */
.list-meta{ display:flex; align-items:center; gap:12px; margin:-6px 0 14px; font-size:13px; }

/* Workspace search box */
.wp-search{ margin-top:18px; max-width:420px; }
.wp-search input[type=search]{ width:100%; }
.toolbar{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-bottom:18px; }
.toolbar input[type=search]{ width:auto; min-width:280px; flex:0 1 360px; }
.toolbar select{ width:auto; min-width:150px; }
table.data th{ text-transform:none; }

/* Role badges */
.role-badge{ display:inline-block; font-size:11px; font-weight:700; padding:3px 10px; border-radius:var(--r-pill);
  text-transform:uppercase; letter-spacing:.05em; }
.role-badge.admin{ background:var(--red-fill); color:var(--red-ink); }
.role-badge.agency{ background:var(--blue-tint); color:var(--info-ink); }
.role-badge.agent{ background:var(--gold-tint); color:var(--ink); }

/* Module-assignment check pills */
.checks{ display:flex; flex-wrap:wrap; gap:8px; }
.check-pill{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--border); border-radius:var(--r-pill);
  padding:7px 13px; font-size:13px; font-weight:600; color:var(--navy); cursor:pointer; user-select:none; background:#fff; transition:var(--tr-fast); }
.check-pill:hover{ border-color:var(--gold); }
.check-pill input{ width:auto; margin:0; accent-color:var(--gold); }
.check-pill.on{ background:var(--gold-tint-strong); border-color:var(--gold); }

/* Module chips (in user rows) */
.mod-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.mod-chip{ font-size:11px; font-weight:600; background:var(--mist); color:var(--navy); border-radius:var(--r-pill); padding:2px 9px; }

.muted{ color:var(--slate); font-size:var(--fs-sm); }   /* body floor: carries emails / module names */
.right{ text-align:right; }
.row-actions{ display:flex; gap:14px; justify-content:flex-end; }
.linklike{ background:none; border:0; color:var(--info); font-weight:600; cursor:pointer; font-size:13px; font-family:inherit; padding:0; }
.linklike.danger{ color:var(--red); }
.am-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.am-grid .full{ grid-column:1/-1; }

/* =====================================================================
   MOBILE-APP VIEW (<=640px) — native-app shell, springboard launcher
   ===================================================================== */

/* Mobile chrome is hidden on desktop */
.wp-appbar{ display:none; }
.wp-tabbar{ display:none; }

@media (max-width:640px){
  /* Hide desktop nav; pad body for fixed app header + tab bar */
  .wp-nav{ display:none !important; }
  body.portal{ background:var(--white); padding-bottom:calc(var(--tabbar-h) + var(--safe-b)); }

  /* ---- Mobile app header (sticky navy trust surface) ---- */
  .wp-appbar{ display:flex; align-items:center; gap:var(--sp-3);
    position:sticky; top:0; z-index:var(--z-nav);
    height:calc(var(--app-header-h) + var(--safe-t));
    padding:var(--safe-t) var(--sp-4) 0 var(--sp-4);
    background:var(--navy); color:#fff;
    box-shadow:0 1px 0 rgba(0,0,0,.06), 0 4px 14px rgba(68,74,107,.18); }
  .wp-appbar .ab-logo{ height:26px; width:auto; min-width:96px; display:block; }   /* brand: full logo >=96px */
  .wp-appbar .ab-title{ font-family:var(--font-display); font-weight:700; font-size:17px; color:#fff; margin-right:auto; }
  .wp-appbar .ab-back{ width:var(--tap); height:var(--tap); margin-left:-10px; display:grid; place-items:center;
    color:#fff; font-size:22px; background:transparent; border:0; border-radius:var(--r-btn); cursor:pointer;
    text-decoration:none; -webkit-tap-highlight-color:transparent; }
  .wp-appbar .ab-back:active{ background:rgba(255,255,255,.12); }
  .wp-appbar .ab-spacer{ margin-left:auto; }
  .wp-appbar .wp-avatar{ width:36px; height:36px; font-size:14px; flex:none; }

  /* ---- Greeting / hero (one dominant element) ---- */
  .wp-main{ max-width:none; margin:0; padding:14px 16px 24px; }
  .wp-eyebrow{ display:none; }
  .wp-hello{ font-size:24px; line-height:1.15; margin:6px 0 4px; color:var(--navy);
    font-family:var(--font-display); font-weight:700; }
  .wp-sub{ font-size:14px; color:var(--slate); margin-bottom:18px; }

  /* ---- Section labels (uppercase kicker, no divider) ---- */
  .wp-section-title{ font-size:13px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
    color:var(--slate); margin:22px 0 12px; }
  .wp-section-title::after{ display:none; }

  /* ---- APP GRID: 4-col squircle tiles, caption beneath ---- */
  .mod-grid{ grid-template-columns:repeat(4,1fr); gap:14px 10px; }
  .mod-tile{ background:transparent; border:0; box-shadow:none; padding:0; gap:0; border-radius:0;
    flex-direction:column; align-items:center; text-align:center; }
  .mod-tile:hover{ transform:none; box-shadow:none; border:0; }
  .mod-tile:active .mod-ico{ transform:scale(.94); }
  .mod-ico{ width:100%; aspect-ratio:1; height:auto; max-width:62px; min-height:56px; margin:0 auto 7px;
    border-radius:var(--r-tile); font-size:26px; box-shadow:inset 0 0 0 1px rgba(68,74,107,.05);
    transition:transform var(--tr-fast); }
  .mod-tile .tile-text{ align-items:center; width:100%; }
  .mod-tile strong{ font-size:12px; font-weight:600; color:var(--ink); line-height:1.25; text-align:center; width:100%;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .mod-tile small{ display:none; }
  .mod-tile.soon .mod-ico{ opacity:.45; }
  .mod-tile.soon strong{ color:var(--slate); }
  .mod-tile .soon-tag{ top:-4px; right:50%; left:auto; transform:translateX(50%); font-size:11px; padding:1px 6px;
    background:var(--navy); color:#fff; letter-spacing:.02em; }
  .wp-empty{ padding:40px 20px; border-radius:var(--r-card); font-size:14px; }

  /* ---- Fixed bottom tab bar (safe-area aware) ---- */
  .wp-tabbar{ display:flex; position:fixed; left:0; right:0; bottom:0; z-index:var(--z-tabbar);
    height:calc(var(--tabbar-h) + var(--safe-b)); padding-bottom:var(--safe-b);
    background:rgba(255,255,255,.96); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
    border-top:1px solid var(--border); box-shadow:0 -2px 12px rgba(68,74,107,.08); }
  .wp-tab{ position:relative; flex:1 1 0; min-height:var(--tap);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    background:transparent; border:0; cursor:pointer; font-family:inherit; text-decoration:none;
    color:var(--slate); font-size:11px; font-weight:600; -webkit-tap-highlight-color:transparent; }
  .wp-tab .ti{ font-size:21px; line-height:1; }
  .wp-tab.active{ color:var(--navy); }
  .wp-tab.active::before{ content:""; position:absolute; top:0; width:26px; height:3px;
    border-radius:0 0 var(--r-pill) var(--r-pill); background:var(--gold); }
  .wp-tab[hidden]{ display:none; }

  /* ---- Login screen (single-column sheet) ---- */
  .login-wrap{ min-height:100dvh; display:flex; flex-direction:column; justify-content:center;
    align-items:stretch; place-items:initial;
    padding:calc(var(--safe-t) + 24px) 18px calc(var(--safe-b) + 24px);
    background:linear-gradient(160deg,var(--navy),#2d3149); }
  .login-card{ max-width:none; width:100%; border-radius:22px;
    padding:30px 22px calc(26px + var(--safe-b)); box-shadow:0 18px 50px rgba(0,0,0,.28); }
  .login-card .brand img{ height:38px; }
  .login-card h1{ font-size:22px; }
  .login-card .sub{ font-size:var(--fs-sm); margin-bottom:22px; }
  .login-card input{ font-size:16px; padding:13px 14px; min-height:var(--tap); border-radius:var(--r-btn); }
  .login-card .btn{ min-height:50px; font-size:16px; border-radius:14px; margin-top:20px; }
  .demo-box .row{ padding:9px 0; min-height:var(--tap); align-items:center; }

  /* ---- Back office (mobile) ---- */
  .admin-shell{ padding:14px 14px 24px; max-width:none; }
  .bo-head{ margin-bottom:14px; align-items:center; }
  .bo-head h1{ display:none; }
  .bo-head-actions .btn{ min-height:var(--tap); flex:none; }
  .tabs{ position:sticky; top:calc(var(--app-header-h) + var(--safe-t)); z-index:40;
    background:var(--white); margin:0 -14px 14px; padding:0 14px; border-bottom:1px solid var(--border); }
  .tabs button{ flex:1; min-height:var(--tap); padding:11px 8px; font-size:14px; }
  .toolbar{ gap:8px; }
  .toolbar input,.toolbar select{ width:100%; min-width:0; min-height:var(--tap); font-size:16px; flex:1 1 100%; }
  /* Pair the filter dropdowns two-per-row so three of them don't eat the screen */
  .toolbar select{ flex:1 1 calc(50% - 4px); }
  #newUserBtn{ width:100%; margin-left:0 !important; min-height:46px; }
  /* Workspace search: full width, 16px so iOS doesn't zoom on focus */
  .wp-search{ max-width:none; margin-top:14px; }
  .wp-search input[type=search]{ font-size:16px; min-height:var(--tap); }
  .list-meta{ margin:-2px 0 12px; }

  /* Tables: horizontal scroll with frozen identity column */
  table.data{ -webkit-overflow-scrolling:touch; font-size:var(--fs-sm); border-radius:var(--r-card); }
  table.data th,table.data td{ padding:10px 12px; }
  table.data th:first-child,table.data td:first-child{ position:sticky; left:0; background:var(--white); z-index:1;
    box-shadow:1px 0 0 var(--border); }
  table.data th:first-child{ background:var(--mist); }
  .row-actions{ justify-content:flex-start; }
  .row-actions .linklike{ min-height:var(--tap); padding:0 4px; }

  /* Modals → full-width bottom sheets */
  .admin-modal-bg{ padding:0; place-items:end stretch; }
  .admin-modal-bg.show{ display:grid; align-items:end; }
  .admin-modal{ max-width:none; width:100%; max-height:96dvh; border-radius:18px 18px 0 0;
    display:flex; flex-direction:column; animation:sheet-up .26s cubic-bezier(.22,.61,.36,1); }
  @keyframes sheet-up{ from{ transform:translateY(100%); } to{ transform:none; } }
  .admin-modal header{ position:sticky; top:0; background:#fff; z-index:2; padding:16px 18px; border-radius:18px 18px 0 0; }
  .admin-modal header::before{ content:""; position:absolute; top:7px; left:50%; transform:translateX(-50%);
    width:40px; height:4px; border-radius:var(--r-pill); background:var(--border); }
  .admin-modal header h3{ font-size:17px; }
  .admin-modal .icon-btn{ width:var(--tap); height:var(--tap); font-size:18px; }
  .admin-modal .am-body{ padding:16px 18px; overflow:auto; flex:1; }
  .am-grid{ grid-template-columns:1fr; gap:14px; }
  .am-body input,.am-body select{ font-size:16px; min-height:var(--tap); }
  .check-pill{ min-height:var(--tap); }
  .hc-actions{ position:sticky; bottom:0; background:#fff; margin:0 -18px -16px;
    padding:14px 18px calc(14px + var(--safe-b)); border-top:1px solid var(--border); flex-direction:row; }
  .hc-actions .btn{ flex:1; min-height:48px; justify-content:center; }
}

/* very narrow phones → 3 columns so captions don't crush */
@media (max-width:380px){ .mod-grid{ grid-template-columns:repeat(3,1fr); } }

/* ===== Hub tiles + drill-down ===== */
.mod-tile.hub{ cursor:pointer; }
.hub-badge{ position:absolute; top:12px; right:12px; font-size:11px; font-weight:700; color:var(--navy);
  background:var(--gold-tint); border-radius:var(--r-pill); padding:2px 9px; letter-spacing:.02em; }
@media (max-width:640px){
  .hub-badge{ top:-4px; right:50%; transform:translateX(50%); background:var(--navy); color:#fff; }
}
.wp-drill-head{ margin:4px 0 18px; }
.wp-drill-head .drill-back{ background:none; border:0; color:var(--info); font-weight:600; font-size:14px;
  cursor:pointer; padding:6px 0; font-family:inherit; min-height:var(--tap); }
.wp-drill-head .drill-title{ font-family:var(--font-display); font-weight:700; color:var(--navy);
  font-size:clamp(22px,3vw,28px); margin:8px 0 4px; }
.wp-drill-head .drill-sub{ color:var(--slate); font-size:15px; }

/* ===== Back-office Layout (drag-arrange) ===== */
.layout-board{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px; align-items:start; }
.lay-group{ background:var(--mist); border:1px solid var(--border); border-radius:var(--r-card); padding:12px; }
.lay-group-h{ display:flex; align-items:center; gap:6px; margin:2px 4px 10px; }
.lay-group-h .lg-name{ font-family:var(--font-display); font-weight:700; color:var(--navy); font-size:13px;
  text-transform:uppercase; letter-spacing:.04em; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; }
/* Group controls stay quiet until the column is hovered, so the board still
   reads as a layout tool rather than a row of buttons. */
.lay-group-h .lg-actions{ display:flex; gap:2px; opacity:0; transition:opacity var(--tr-fast); }
.lay-group:hover .lg-actions,.lay-group:focus-within .lg-actions{ opacity:1; }
.lg-btn{ width:24px; height:24px; display:grid; place-items:center; border:0; background:transparent;
  border-radius:6px; cursor:pointer; color:var(--slate); font-size:12px; font-family:inherit; line-height:1; }
.lg-btn:hover:not([disabled]){ background:#fff; color:var(--navy); }
.lg-btn.danger:hover:not([disabled]){ color:var(--red); }
.lg-btn[disabled]{ opacity:.25; cursor:default; }
@media (max-width:640px){ .lay-group-h .lg-actions{ opacity:1; } .lg-btn{ width:var(--tap); height:32px; } }
.lay-list{ display:flex; flex-direction:column; gap:8px; min-height:52px; }
.lay-card{ display:flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--border);
  border-radius:var(--r-card); padding:10px 12px; font-size:14px; font-weight:600; color:var(--ink);
  cursor:grab; box-shadow:var(--shadow); user-select:none; }
.lay-card:active{ cursor:grabbing; }
.lay-card .lay-ico{ font-size:18px; }
.lay-card.dragging{ opacity:.45; border-style:dashed; }

/* =====================================================================
   SSO onboarding & integrations (invites, register wizard, settings)
   Additive only — brand tokens throughout, no design-language changes.
   ===================================================================== */

/* Invite status chips — semantic classes on the existing .badge pill */
.badge.st-invited{ background:var(--gold-tint); color:var(--gold-text); }
.badge.st-registered{ background:var(--info-fill); color:var(--info-ink); }
.badge.st-email_verified{ background:var(--info-fill); color:var(--info-ink); }
.badge.st-active{ background:var(--green-fill); color:var(--green-ink); }
.badge.st-suspended{ background:var(--red-fill); color:var(--red-ink); }
.badge.st-expired{ background:var(--mist); color:var(--slate); }
.badge.st-revoked{ background:var(--red-fill); color:var(--red-ink); }

/* Copy-link row (invite modal + onboarding) */
.copy-row{ display:flex; gap:8px; }
.copy-row input[readonly]{ flex:1; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px;
  background:var(--mist); color:var(--navy); }

/* Settings tab */
/* In-app confirm dialog (native confirm() is unusable in embedded webviews) */
.confirm-modal{ max-width:420px; }
.cf-msg{ color:var(--slate); font-size:14.5px; line-height:1.55; margin:0; }
.btn-danger{ background:var(--red); color:#fff; border-color:var(--red); }
.btn-danger:hover{ background:#c93a2e; border-color:#c93a2e; box-shadow:var(--shadow-lift); }

.settings-grid{ display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
.set-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:16px; }
.set-head h3{ font-size:var(--fs-h3); }
.set-card .hc-actions{ justify-content:flex-end; margin-top:20px; }
@media (max-width:900px){ .settings-grid{ grid-template-columns:1fr; } }

/* Outbox log — keep long bodies readable */
#msgTable td{ max-width:420px; overflow-wrap:anywhere; white-space:normal; }
#msgTable .msg-body{ font-size:12.5px; color:var(--slate); }

/* ===== Register wizard (public page — reuses the login shell) ===== */
.reg-card{ max-width:520px; }
.reg-card .hc-progress{ border-radius:var(--r-pill); overflow:hidden; margin:6px 0 22px; }
.reg-glyph{ width:64px; height:64px; border-radius:50%; background:var(--mist); display:grid;
  place-items:center; font-size:28px; margin:0 auto 14px; }
.reg-glyph.ok{ background:var(--green-fill); color:var(--green-ink); font-weight:800; }
.reg-glyph.bad{ background:var(--red-fill); color:var(--red-ink); font-weight:800; }
.reg-card .hc-step h2{ font-family:var(--font-display); color:var(--navy); }
.reg-center{ text-align:center; }
.reg-card label{ margin-top:14px; }
.reg-card .btn{ width:100%; margin-top:22px; justify-content:center; text-align:center; }
.reg-card .btn + .btn{ margin-top:10px; }
.otp-input{ font-family:ui-monospace,Menlo,Consolas,monospace; font-size:26px; letter-spacing:.5em;
  text-align:center; max-width:260px; margin:14px auto 0; display:block; }
/* Dial-code + national-number pair on the registration form */
.phone-row{ display:flex; gap:8px; }
.phone-row select{ flex:0 0 auto; width:auto; max-width:45%; }
.phone-row input{ flex:1; }
/* Inline "wrong number?" editor on the OTP step */
.phone-edit{ display:flex; gap:8px; justify-content:center; align-items:center; margin-top:12px; flex-wrap:wrap; }
.phone-edit select{ flex:0 0 auto; width:auto; max-width:150px; }
.phone-edit input{ flex:1; min-width:140px; max-width:220px; }
.phone-edit .btn{ width:auto; margin-top:0; }

/* =====================================================================
   Notification bell (nav, every signed-in page) + its modal
   Injected by assets/notifications.js, so these are the only styles it needs.
   ===================================================================== */
.notif-bell{ position:relative; width:38px; height:38px; flex:none; display:grid; place-items:center;
  background:transparent; border:1px solid var(--border); border-radius:50%; cursor:pointer;
  font-family:inherit; transition:var(--tr-fast); -webkit-tap-highlight-color:transparent; }
.notif-bell:hover{ border-color:var(--gold); background:var(--mist); }
.notif-bell .nb-ico{ font-size:17px; line-height:1; }
/* The count rides on the bell so it reads at a glance from any page. */
.notif-bell .nb-dot{ position:absolute; top:-3px; right:-3px; min-width:18px; height:18px; padding:0 4px;
  border-radius:var(--r-pill); background:var(--red); color:#fff; font-size:11px; font-weight:700;
  line-height:18px; text-align:center; box-shadow:0 0 0 2px #fff; }
.notif-bell.has-unread{ border-color:var(--gold); }
/* On the navy mobile app bar the outline has to invert to stay visible. */
.wp-appbar .notif-bell{ border-color:rgba(255,255,255,.35); width:36px; height:36px; }
.wp-appbar .notif-bell:hover{ background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.6); }
.wp-appbar .notif-bell .nb-dot{ box-shadow:0 0 0 2px var(--navy); }

.notif-modal{ max-width:620px; }
.notif-tools{ display:flex; gap:16px; align-items:center; margin:4px 0 12px; }
.notif-item{ display:flex; gap:12px; align-items:flex-start; padding:13px 0; border-bottom:1px solid var(--border); }
.notif-item:last-child{ border-bottom:0; }
.notif-item.done{ opacity:.6; }
.notif-item .ni-ico{ width:38px; height:38px; flex:none; border-radius:12px; background:var(--gold-tint);
  display:grid; place-items:center; font-size:19px; }
.notif-item .ni-main{ flex:1; min-width:0; font-size:var(--fs-sm); line-height:1.45; }
.notif-item .ni-main b{ color:var(--ink); font-weight:600; }
.notif-item .ni-meta{ font-size:12.5px; color:var(--slate); margin-top:3px; font-variant-numeric:tabular-nums; }
.notif-item .ni-side{ flex:none; display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
@media (max-width:640px){
  .notif-item{ flex-wrap:wrap; }
  .notif-item .ni-side{ flex-direction:row; align-items:center; width:100%; justify-content:space-between; }
  .notif-item .ni-side .linklike{ min-height:var(--tap); }
}

/* =====================================================================
   Account settings (/settings) — profile, security, my access
   Reuses .card / .set-card / .am-grid / .hc-actions / table.data; only the
   bits with no existing equivalent are defined here.
   ===================================================================== */
.acct-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:20px; align-items:start; }
/* Identity strip at the top of the details card */
.acct-id{ display:flex; align-items:center; gap:14px; padding-bottom:18px; margin-bottom:4px;
  border-bottom:1px solid var(--border); }
.acct-avatar{ width:52px; height:52px; font-size:19px; flex:none; }
.acct-id-text{ min-width:0; line-height:1.35; }
.acct-id-text b{ display:block; font-size:16px; color:var(--ink); font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acct-id-text .muted{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* The current phone number: a value, not a form field */
.acct-value{ font-size:16px; font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums;
  margin:0 0 10px; }
/* Read-only rows for the admin-owned fields */
.ro-rows{ display:grid; gap:2px; margin-bottom:14px; }
.ro-rows > div{ display:flex; justify-content:space-between; align-items:baseline; gap:16px;
  padding:9px 0; border-bottom:1px solid var(--border); }
.ro-rows > div:last-child{ border-bottom:0; }
.ro-rows dt{ font-size:13px; font-weight:600; color:var(--slate); }
.ro-rows dd{ font-size:var(--fs-sm); color:var(--ink); text-align:right; overflow-wrap:anywhere; }
/* My access: the module pills are labels here, not controls */
.check-pill.static{ cursor:default; }
.check-pill.static:hover{ border-color:var(--gold); }
/* The phone card's OTP box sits in a narrow card — keep it from overflowing */
#phoneCard .otp-input{ max-width:220px; margin:12px 0 0; }
#phoneCard .hc-actions,#profileForm .hc-actions,#passForm .hc-actions{ justify-content:flex-end; margin-top:18px; flex-wrap:wrap; }
#sessTable + .hc-actions{ justify-content:flex-end; margin-top:16px; }

@media (max-width:640px){
  /* 5 admin tabs: scroll, don't crush */
  .tabs{ overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap; }
  .tabs button{ flex:0 0 auto; white-space:nowrap; }
  /* Full-width primary buttons in toolbars (matches #newUserBtn rule) */
  #newInviteBtn{ width:100%; margin-left:0 !important; min-height:46px; }
  .copy-row .btn{ min-height:var(--tap); }
  .set-card input,.set-card select{ font-size:16px; min-height:var(--tap); }
  .set-card .hc-actions{ position:static; margin:20px 0 0; padding:0; border-top:0; }

  /* ---- Account settings (mobile) ----
     The bare `.hc-actions` sticky-sheet rule above targets modal footers; any
     action row sitting inside a page card must opt out of it, or it detaches
     and pins itself to the bottom of the screen. */
  .admin-shell .card .hc-actions{ position:static; margin:18px 0 0; padding:0; border-top:0; }
  /* Natural width + wrap beats the modal footer's flex:1, which would squeeze
     three buttons into one row and wrap their labels. A lone action (Save) still
     spans the card, which is the right target size on a phone. */
  .admin-shell .card .hc-actions .btn{ min-height:46px; flex:0 1 auto; }
  .admin-shell .card .hc-actions .btn:only-child{ flex:1 1 100%; }
  .acct-grid{ grid-template-columns:1fr; gap:16px; }
  .acct-id-text b{ font-size:15px; }
  #phoneCard .otp-input{ max-width:none; width:100%; font-size:22px; }
  .ro-rows dd{ font-size:13.5px; }
}
