.portal-login-label{display:grid;justify-items:center;gap:5px;margin-top:16px;font-size:12px;line-height:1.5}
.portal-login-label strong{font-size:14px;letter-spacing:.04em;font-weight:600;color:#fff}
.portal-login-label a{color:#e0d4c6!important;font-size:12px;word-break:break-all;text-decoration:none}
.portal-login-label a:hover{text-decoration:underline}
.staff-workspace-header{background:#232323;border-bottom:1px solid #55493d;padding-top:18px;padding-bottom:18px}
.staff-workspace-header .staff-brand{display:flex;gap:14px;align-items:center;text-decoration:none;color:white;min-width:0}
.staff-brand img{width:22px;height:48px;object-fit:contain}
.staff-brand span{display:grid;gap:3px;min-width:0}
.staff-brand strong{font-size:18px;font-weight:600}
.staff-brand small{font-size:12px;color:#d3c6b7;overflow-wrap:anywhere}
body:not(.staff-login-active) main{max-width:1180px;padding-top:32px}
#overview .staff-welcome{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:22px}
#overview .staff-context{color:#6b6259;margin:0}
#overview .staff-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:24px}
#overview .staff-home-tiles{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:24px}
#overview .staff-home-tiles .staff-tile{min-height:210px}
#overview .staff-back{margin:0 0 18px}
@media(min-width:601px) and (max-width:850px){#overview .staff-home-tiles{grid-template-columns:minmax(0,1fr)}#overview .staff-home-tiles .staff-tile{min-height:0}}
#overview .staff-tile{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:24px;border:1px solid #ded7ce;border-top:3px solid #8c6f55;border-radius:8px;background:white;color:#302b26;text-decoration:none}
#overview .staff-tile:hover{border-color:#8c6f55;background:#fdfbf8}
#overview .staff-tile strong{font-size:19px;line-height:1.3}
#overview .staff-tile p{margin:0;color:#675d53}
#overview .staff-tile .staff-tile-action{display:inline-block;margin-top:auto;padding-top:8px;color:#725840;font-weight:600}
#overview .staff-section{padding:0;margin:0 0 22px;border-radius:8px;overflow:hidden}
#overview .staff-section-heading{padding:18px 22px;background:#faf8f5;border-bottom:1px solid #e5dfd6;display:flex;justify-content:space-between;align-items:center;gap:10px}
#overview .staff-section-heading h2{font-size:17px;margin:0}
#overview .staff-section-body{padding:0 22px}
#overview .staff-handover-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 0;border-bottom:1px solid #ece7df;text-decoration:none;color:inherit;flex-wrap:wrap}
#overview .staff-handover-row:last-child{border-bottom:0}
#overview .staff-handover-row:hover strong{color:#725840;text-decoration:underline}
#overview .staff-row-text{display:grid;gap:4px;min-width:0;overflow-wrap:anywhere}
#overview .staff-row-text small{color:#675d53}
#overview .staff-empty{padding:24px 0;color:#675d53;margin:0}
#overview .staff-status{display:inline-block;padding:4px 10px;background:#ede9e3;color:#54483c;border-radius:14px;font-size:12px;white-space:nowrap}
#overview .staff-status[data-status="Awaiting signature"]{background:#f6ecd6;color:#705017}
#overview .staff-status[data-status^="Signed"]{background:#e6eee4;color:#37553a}
#overview .staff-refresh-note{font-size:13px;color:#675d53}
@media(max-width:600px){
  .staff-workspace-header{padding:14px 18px}
  body:not(.staff-login-active) main{padding:24px 16px}
  #overview .staff-tiles{grid-template-columns:minmax(0,1fr);gap:12px}
  #overview .staff-home-tiles .staff-tile{min-height:0}
  #overview .staff-tile{padding:20px}
  #overview .staff-section-heading{padding:15px 18px}
  #overview .staff-section-body{padding:0 18px}
}


/* ============================================================================
   v105 Staff Portal Shell Parity with Admin Portal:
   - Liquid-Glass Side Rail (matches Admin v89/v91)
   - Top Bar controls: Refresh, Appearance (4 themes/motion/density), User Pill
   - Full 4-Theme support: Park Bronze, Warm Ivory, Cool Slate, Dark Charcoal
   ============================================================================ */
:root {
  --v89-bronze: #8C6F55;
  --v89-bronze-wash: rgba(168, 137, 109, 0.14);
}
body.staff-has-rail:not(.staff-login-active) {
  font-family: "Saans", "Segoe UI", Arial, sans-serif;
}

/* Side Rail group headers & Admin-matched Liquid-Glass active pill */
.staff-rail {
  background: #232220 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.staff-rail-group {
  padding: 16px 12px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(214, 206, 196, 0.54);
  user-select: none;
}
html body .staff-rail nav.staff-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 10px 18px;
}
html body .staff-rail nav.staff-rail-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #D7D2CC;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease !important;
}
html body .staff-rail nav.staff-rail-nav a:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #FFFFFF !important;
}
html body .staff-rail nav.staff-rail-nav a[aria-current="page"],
html body .staff-rail nav.staff-rail-nav a[aria-current="page"]:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.20) 0%,
    rgba(168, 137, 109, 0.42) 54%,
    rgba(255, 255, 255, 0.08) 100%
  ) !important;
  border: 1px solid rgba(212, 183, 155, 0.78) !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -1px 0 rgba(168, 137, 109, 0.36),
    0 6px 16px rgba(0, 0, 0, 0.30);
}
html body .staff-rail nav.staff-rail-nav a .rail-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html body .staff-rail nav.staff-rail-nav a .rail-count[hidden] { display: none !important; }

/* Staff Top Bar — identical right-side Refresh, Appearance & User Pill to Admin */
.staff-topbar {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  min-height: 58px;
}
.staff-topbar-title { min-width: 0; }
.staff-topbar .topbar-crumb { display: block; font-size: 13.5px; font-weight: 600; color: #FFFFFF; }
.staff-topbar .crumb-root { color: #CFC6BB; font-weight: 500; }
.staff-topbar .topbar-h1 { display: none; }
.staff-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
html body .staff-topbar .portal-header-control {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px !important;
  padding: 0 13px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease;
}
html body .staff-topbar .portal-header-control:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}
.staff-topbar details > summary::-webkit-details-marker { display: none; }
.staff-top-ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.staff-top-btn.is-spinning .staff-top-ic { animation: staffSpin 0.7s linear infinite; }
@keyframes staffSpin { to { transform: rotate(360deg); } }

/* Topbar Popovers (Appearance & User Account) */
.staff-topbar .topbar-appearance,
.staff-topbar .topbar-account { position: relative; }
.staff-topbar .portal-appearance-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  padding: 14px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #DFDAD2;
  box-shadow: 0 16px 38px rgba(20, 17, 14, 0.22);
  color: #232323;
  z-index: 90;
}
.staff-topbar .v91-ap-sec { padding: 9px 0; border-bottom: 1px solid #E4DFD8; }
.staff-topbar .v91-ap-sec:first-child { padding-top: 2px; }
.staff-topbar .v91-ap-sec:last-child { border-bottom: 0; padding-bottom: 2px; }
.staff-topbar .v91-ap-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #8A857E; margin-bottom: 7px; }
.staff-topbar .v91-ap-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
html body .staff-topbar .v91-ap-theme-btn {
  display: flex !important; align-items: center; gap: 7px;
  padding: 7px 9px !important; border-radius: 8px !important;
  border: 1px solid #DDD8D1 !important; background: #F7F6F4 !important;
  color: #232323 !important; font-size: 12px !important; font-weight: 500 !important;
  cursor: pointer; text-align: left;
}
html body .staff-topbar .v91-ap-theme-btn:hover { border-color: var(--v89-bronze) !important; }
html body .staff-topbar .v91-ap-theme-btn.is-on {
  border-color: var(--v89-bronze) !important;
  background: var(--v89-bronze-wash) !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1px var(--v89-bronze);
}
.staff-topbar .v91-swatch { width: 14px; height: 14px; border-radius: 999px; flex: none; border: 1px solid rgba(0, 0, 0, 0.18); }
.staff-topbar .v91-ap-seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px;
  border-radius: 9px; background: #F2EFEA; border: 1px solid #E2DFDA;
}
html body .staff-topbar .v91-ap-seg button {
  border: 0 !important; background: transparent !important; color: #474747 !important;
  font-size: 11.5px !important; font-weight: 600 !important; padding: 6px 4px !important;
  border-radius: 6px !important; cursor: pointer; white-space: nowrap;
}
html body .staff-topbar .v91-ap-seg button.is-on {
  background: #232323 !important; color: #FFFFFF !important;
}
.staff-topbar .v91-ap-hint { font-size: 11px; color: #8A857E; margin-top: 5px; line-height: 1.35; }
.staff-topbar .v91-ap-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
html body .staff-topbar .v91-ap-reset {
  border: 1px solid #DDD8D1 !important; background: #FFFFFF !important; color: #474747 !important;
  font-size: 11.5px !important; font-weight: 600 !important; cursor: pointer;
  padding: 4px 9px !important; border-radius: 6px !important;
}
html body .staff-topbar .v91-ap-reset:hover { border-color: var(--v89-bronze) !important; color: #232323 !important; }

/* User Pill & Account Dropdown */
html body .staff-topbar .staff-user-pill {
  padding: 0 11px 0 4px !important;
  border-radius: 999px !important;
  gap: 8px;
}
.staff-topbar .topbar-account .rail-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #EFE6DA; color: #3A2A1C;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none;
}
.staff-user-text { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-user-chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; opacity: 0.8; flex: none; }
.staff-topbar .staff-user-menu { width: 240px; padding: 10px; }
.staff-user-card { padding: 6px 8px 10px; border-bottom: 1px solid #E8E3DC; margin-bottom: 6px; }
.staff-user-card b { display: block; font-size: 13.5px; color: #232323; }
.staff-user-card small { display: block; font-size: 11.5px; color: #7C756D; margin-top: 2px; }
html body .staff-menu-item {
  display: flex !important; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px !important; border: 0 !important; border-radius: 8px !important;
  background: transparent !important; color: #2E2B28 !important;
  font-size: 13px !important; font-weight: 500 !important; text-decoration: none;
  cursor: pointer; text-align: left;
}
html body .staff-menu-item:hover { background: #F4EFE8 !important; }
html body .staff-menu-item.staff-menu-logout { color: #A12D2D !important; }
html body .staff-menu-item.staff-menu-logout:hover { background: #FBECEC !important; }
.staff-menu-ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- 4 THEMES FOR STAFF PORTAL ---- */
/* 1. Warm Ivory */
html.v91-theme-ivory body.staff-has-rail:not(.staff-login-active) { background: #F1ECE3 !important; }
html.v91-theme-ivory #overview .staff-tile,
html.v91-theme-ivory #overview .staff-section,
html.v91-theme-ivory main .panel { background: #FBF9F5 !important; border-color: #E2D9CC !important; }

/* 2. Cool Slate */
html.v91-theme-slate { --v89-bronze: #4A6A7E; --v89-bronze-wash: rgba(74, 106, 126, 0.14); }
html.v91-theme-slate body.staff-has-rail:not(.staff-login-active) { background: #EAEFF4 !important; }
html.v91-theme-slate body .staff-topbar {
  background: linear-gradient(90deg, #1E2832 0%, #2B3D4D 34%, #3D5B70 70%, #5B8098 100%) !important;
}
html.v91-theme-slate .staff-rail { background: #1E262E !important; }
html.v91-theme-slate .staff-rail nav.staff-rail-nav a[aria-current="page"],
html.v91-theme-slate .staff-rail nav.staff-rail-nav a[aria-current="page"]:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.20) 0%, rgba(100,145,175,0.44) 55%, rgba(255,255,255,0.08) 100%) !important;
  border-color: rgba(164, 200, 224, 0.78) !important;
}
html.v91-theme-slate #overview .staff-tile { border-top-color: #4A6A7E !important; }
html.v91-theme-slate #overview .staff-tile .staff-tile-action { color: #3A596E !important; }

/* 3. Dark Charcoal */
html.v91-theme-dark body.staff-has-rail:not(.staff-login-active) {
  background: #181715 !important;
  color: #ECE7E0 !important;
}
html.v91-theme-dark .staff-rail { background: #141311 !important; border-right-color: #2E2C28; }
html.v91-theme-dark body .staff-topbar {
  background: linear-gradient(90deg, #141311 0%, #24211D 35%, #4B3B2D 72%, #7D634C 100%) !important;
}
html.v91-theme-dark #overview .staff-tile,
html.v91-theme-dark #overview .staff-section,
html.v91-theme-dark main .panel,
html.v91-theme-dark .ticket-workspace,
html.v91-theme-dark .ticket-panel,
html.v91-theme-dark .staff-topbar .portal-appearance-menu {
  background: #232220 !important;
  border-color: #3A3732 !important;
  color: #ECE7E0 !important;
}
html.v91-theme-dark #overview .staff-tile:hover { background: #2B2926 !important; border-color: #A8896D !important; }
html.v91-theme-dark #overview .staff-tile strong,
html.v91-theme-dark #overview h1, html.v91-theme-dark #overview h2,
html.v91-theme-dark main h1, html.v91-theme-dark main h2, html.v91-theme-dark main h3,
html.v91-theme-dark .staff-user-card b { color: #F7F4F0 !important; }
html.v91-theme-dark #overview .staff-tile p,
html.v91-theme-dark #overview .staff-context,
html.v91-theme-dark #overview .staff-row-text small,
html.v91-theme-dark #overview .staff-empty,
html.v91-theme-dark .staff-user-card small,
html.v91-theme-dark .staff-topbar .v91-ap-title,
html.v91-theme-dark .staff-topbar .v91-ap-hint { color: #BDB6AC !important; }
html.v91-theme-dark #overview .staff-tile .staff-tile-action { color: #D8BE9F !important; }
html.v91-theme-dark #overview .staff-section-heading { background: #2B2926 !important; border-bottom-color: #3A3732 !important; }
html.v91-theme-dark #overview .staff-handover-row { border-bottom-color: #35322E !important; }
html.v91-theme-dark .staff-topbar .v91-ap-sec,
html.v91-theme-dark .staff-user-card { border-bottom-color: #3A3732 !important; }
html.v91-theme-dark .staff-topbar .v91-ap-theme-btn { background: #2C2A27 !important; border-color: #44403A !important; color: #EAE5DF !important; }
html.v91-theme-dark .staff-topbar .v91-ap-theme-btn.is-on { background: rgba(168,137,109,0.24) !important; border-color: #C4A586 !important; color: #FFFFFF !important; }
html.v91-theme-dark .staff-topbar .v91-ap-seg { background: #1A1917 !important; border-color: #3A3732 !important; }
html.v91-theme-dark .staff-topbar .v91-ap-seg button { color: #BDB6AC !important; }
html.v91-theme-dark .staff-topbar .v91-ap-seg button.is-on { background: #A8896D !important; color: #1E1A16 !important; }
html.v91-theme-dark .staff-topbar .v91-ap-reset { background: #2C2A27 !important; border-color: #44403A !important; color: #E2DDD5 !important; }
html.v91-theme-dark .staff-menu-item { color: #EAE5DF !important; }
html.v91-theme-dark .staff-menu-item:hover { background: #302D29 !important; }
html.v91-theme-dark .staff-menu-item.staff-menu-logout { color: #F49B92 !important; }
html.v91-theme-dark main :is(input:not([type="checkbox"]), select, textarea) {
  background: #1B1A18 !important; border-color: #45413B !important; color: #F5F2EE !important;
}
html.v91-theme-dark .ticket-table th { background: #2B2926 !important; color: #D8D2CA !important; border-color: #3A3732 !important; }
html.v91-theme-dark .ticket-table td { background: #232220 !important; color: #ECE7E0 !important; border-color: #35322E !important; }

/* Compact Density for Staff Portal tables & handover rows */
html.v91-compact .ticket-table :is(th, td) { padding: 5px 8px !important; font-size: 12.5px !important; }
html.v91-compact #overview .staff-handover-row { padding: 10px 0 !important; }

@media (max-width: 720px) {
  .staff-topbar { padding: 0 12px; gap: 8px; }
  .staff-top-btn span { display: none; }
  .staff-user-text { display: none; }
  html body .staff-topbar .staff-user-pill { padding: 0 6px 0 4px !important; }
}

/* v105 fix: override side-rail.css (.staff-topbar>div flex:1 & html:has(body.staff-has-rail) background) */
html body .staff-topbar > .staff-topbar-title { flex: 1 1 auto !important; min-width: 0 !important; }
html body .staff-topbar > .staff-topbar-actions { flex: 0 0 auto !important; margin-left: auto !important; justify-content: flex-end !important; }
html:has(body.staff-has-rail:not(.staff-login-active)),
body.staff-has-rail:not(.staff-login-active) { min-height: 100vh; }
html.v91-theme-bronze:has(body.staff-has-rail:not(.staff-login-active)),
html.v91-theme-bronze body.staff-has-rail:not(.staff-login-active) { background: #EFEEEC !important; }
html.v91-theme-ivory:has(body.staff-has-rail:not(.staff-login-active)),
html.v91-theme-ivory body.staff-has-rail:not(.staff-login-active) { background: #F1ECE3 !important; }
html.v91-theme-slate:has(body.staff-has-rail:not(.staff-login-active)),
html.v91-theme-slate body.staff-has-rail:not(.staff-login-active) { background: #EAEFF4 !important; }
html.v91-theme-dark:has(body.staff-has-rail:not(.staff-login-active)),
html.v91-theme-dark body.staff-has-rail:not(.staff-login-active) { background: #181715 !important; color: #ECE7E0 !important; }
html.v91-theme-dark .itsm-credit { color: #8A837B !important; }
html.v91-theme-dark .itsm-credit button { color: #C6BEB4 !important; }
