:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
.hidden { display: none !important; }

/* Freeze scroll while PDF capture runs (prevents tab "shrink"). */
html.bs-pdf-capturing,
html.bs-pdf-capturing body {
  overflow: hidden !important;
}
html.bs-pdf-capturing .html2canvas-container,
html.bs-pdf-capturing iframe[data-bs-pdf-sandbox] {
  position: fixed !important;
  left: -10000px !important;
  top: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* LOGIN */
.login-page {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}
.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
.login-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(96, 165, 250, 0.28), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(59, 130, 246, 0.22), transparent 30%),
    linear-gradient(145deg, #0f2f8a 0%, #1d4ed8 48%, #2563eb 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  align-items: center;
  isolation: isolate;
}
.login-hero-glow {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(12px);
}
.login-hero-glow-a {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -40px;
  background: rgba(147, 197, 253, 0.18);
  animation: loginFloatA 10s ease-in-out infinite alternate;
}
.login-hero-glow-b {
  width: 360px;
  height: 360px;
  left: -120px;
  bottom: -120px;
  background: rgba(30, 64, 175, 0.35);
  animation: loginFloatB 12s ease-in-out infinite alternate;
}
.login-hero-pattern {
  position: absolute;
  inset: 28px;
  border-radius: 28px;
  background:
    repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 112px);
  opacity: 0.58;
  transform: perspective(960px) rotateY(-8deg) rotateX(4deg);
  animation: loginGridDrift 14s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.login-hero-chip {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(15, 23, 42, 0.24);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}
.login-hero-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #86efac;
  box-shadow: 0 0 0 6px rgba(134, 239, 172, 0.18);
}
.login-hero-chip-calendar {
  top: 52px;
  right: 48px;
  animation: loginChipFloat 6.8s ease-in-out infinite;
}
.login-hero-chip-live {
  right: 68px;
  bottom: 56px;
  animation: loginChipFloat 7.5s ease-in-out infinite reverse;
}
.login-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 520px;
}
.login-hero-logo {
  display: none;
}
.login-hero-title {
  margin: 0 0 18px;
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  perspective: 900px;
  transform-style: preserve-3d;
}
.login-hero-title-animated {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  animation: loginTitleFloat3d 7.5s ease-in-out infinite;
  will-change: transform, filter;
}
.login-hero-title .login-hello {
  display: block;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(22px) translateZ(-40px);
  filter: blur(8px);
  animation:
    loginHeroReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards,
    loginHelloPulse 4.8s ease-in-out 1s infinite;
}
.login-hero-title .login-brand-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0.04em;
  font-weight: 900;
  opacity: 0;
  transform: translateY(26px) translateZ(-24px);
  filter: blur(8px);
  animation: loginHeroReveal 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards;
}
.login-hero-title .login-brand-b {
  display: inline-block;
  flex-shrink: 0;
  /* margin-right: 0.06em; */
  font-size: 1.28em;
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.04em;
  background: linear-gradient(145deg, #ff4d5a 0%, #ff6b4a 22%, #5b8cff 48%, #3eea8a 78%, #22c55e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
  paint-order: stroke fill;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.35))
    drop-shadow(0 8px 18px rgba(15, 23, 42, 0.35));
  transform-origin: center bottom;
  animation: loginBrandBSpin3d 5.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  will-change: transform, filter;
}
.login-hero-title .login-brand-rest {
  color: #fff;
  font-size: 1em;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  animation: loginBrandRestGlow 4.8s ease-in-out infinite;
}
@keyframes loginHeroReveal {
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    filter: blur(0);
  }
}
@keyframes loginTitleFloat3d {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: translate3d(0, -10px, 18px) rotateX(4deg) rotateY(-5deg);
  }
  50% {
    transform: translate3d(0, -4px, 8px) rotateX(1deg) rotateY(4deg);
  }
  75% {
    transform: translate3d(0, -12px, 22px) rotateX(5deg) rotateY(3deg);
  }
}
@keyframes loginBrandBSpin3d {
  0%, 100% {
    transform: translateZ(12px) rotateY(0deg) scale(1);
    filter:
      drop-shadow(0 0 10px rgba(255, 255, 255, 0.35))
      drop-shadow(0 8px 18px rgba(15, 23, 42, 0.35));
  }
  50% {
    transform: translateZ(28px) rotateY(18deg) scale(1.06);
    filter:
      drop-shadow(0 0 14px rgba(91, 140, 255, 0.55))
      drop-shadow(0 14px 24px rgba(15, 23, 42, 0.4));
  }
}
@keyframes loginHelloPulse {
  0%, 100% {
    transform: translateZ(0);
    opacity: 1;
  }
  50% {
    transform: translateZ(10px);
    opacity: 0.92;
  }
}
@keyframes loginBrandRestGlow {
  0%, 100% {
    text-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  }
  50% {
    text-shadow: 0 14px 34px rgba(255, 255, 255, 0.28), 0 8px 22px rgba(15, 23, 42, 0.35);
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-hero-title-animated,
  .login-hero-title .login-hello,
  .login-hero-title .login-brand-b,
  .login-hero-title .login-brand-rest {
    animation: none !important;
    opacity: 1;
    transform: none;
    filter: none;
  }
}
.login-hero-title strong {
  font-weight: 900;
}
.login-hero-copy {
  margin: 0;
  max-width: 460px;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 500;
}
.login-hero-footer {
  margin: 56px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}
.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px 32px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}
.login-panel-inner {
  width: 100%;
  max-width: 420px;
  padding: 36px 34px;
  border-radius: 30px;
  border: 1px solid rgba(211, 223, 242, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.95) 100%);
  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}
.login-panel-inner::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0) 72%);
  pointer-events: none;
}
.login-panel-inner::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.26), transparent);
  pointer-events: none;
}
.login-panel-badge {
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d7e5ff;
  background: #eff6ff;
  color: #1e40af;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.login-panel-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.18);
}
.login-panel-brand {
  margin: 0 0 22px;
  max-width: 420px;
}
.login-panel-brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 112px;
  object-fit: contain;
}
.login-panel-title {
  margin: 0 0 12px;
  font-size: clamp(26px, 2.8vw, 32px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #0f172a;
  text-align: center;
}
.login-panel-lead {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.6;
  color: #64748b;
  font-weight: 500;
  text-align: center;
}
.auth-signin-block {
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 380px;
}
.auth-continue {
  display: none;
}
.login-signin-frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.google-btn-shell,
.login-google-btn-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 56px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: transform 0.22s ease;
}
.login-google-btn {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease;
}
.google-btn-shell:hover .login-google-btn,
.login-google-btn-wrap:hover .login-google-btn,
.google-btn-shell:focus-within .login-google-btn,
.login-google-btn-wrap:focus-within .login-google-btn {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 100%);
  color: #1e3a8a;
  box-shadow:
    0 10px 24px rgba(37, 99, 235, 0.18),
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 0 0 4px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}
.google-btn-shell:hover,
.login-google-btn-wrap:hover,
.google-btn-shell:focus-within,
.login-google-btn-wrap:focus-within {
  transform: translateY(-1px);
}
.google-btn-shell:active .login-google-btn,
.login-google-btn-wrap:active .login-google-btn {
  transform: translateY(0);
  box-shadow:
    0 4px 12px rgba(37, 99, 235, 0.14),
    0 1px 3px rgba(15, 23, 42, 0.06);
}
.login-google-btn-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}
.google-btn-shell:hover .login-google-btn-icon,
.login-google-btn-wrap:hover .login-google-btn-icon {
  transform: scale(1.06);
}
.login-google-btn-hitbox {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.02;
  overflow: hidden;
  border-radius: 999px;
}
.google-signin-area {
  min-height: 56px;
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  margin-bottom: 0;
}
.google-signin-skeleton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  min-height: 56px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}
.google-signin-skeleton-icon {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: googleSignInSpin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes googleSignInSpin {
  to { transform: rotate(360deg); }
}
.google-signin-error {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  text-align: center;
}
.google-btn-inner {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  justify-content: center;
}
.bootstrap-fields {
  margin: 0 0 18px;
  text-align: left;
}
.bootstrap-fields input {
  width: 100%;
  margin-bottom: 10px;
  border: none;
  border-bottom: 1px solid #cbd5e1;
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
}
.helper-text { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 0 0 10px; }
.invite-hint {
  margin: 16px 0 0;
  color: #5b6b82;
  font-size: 13px;
  line-height: 1.55;
}
.security-note {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #e9eff8;
  font-size: 13px;
  color: #55657c;
  line-height: 1.55;
}
.auth-message { margin-top: 14px; color: #b91c1c; font-size: 13px; min-height: 18px; }
.login-page .banner {
  margin-bottom: 14px;
  text-align: left;
}
@keyframes loginFloatA {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-16px, 18px, 0); }
}
@keyframes loginFloatB {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(18px, -14px, 0); }
}
@keyframes loginGridDrift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 72px -36px, -48px 24px; }
}
@keyframes loginChipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* APP SHELL */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 270px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 16px; border-bottom: 1px solid #eef2f7; }
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #dbeafe, #e0e7ff);
}
.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.mini-calendar {
  border: 1px solid #edf2f7;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}
.mini-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mini-cal-head p { margin: 0; font-size: 11px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.mini-cal-month-wrap { display: inline-flex; align-items: center; gap: 6px; }
.mini-cal-nav {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: default;
}
.mini-cal-month {
  background: #eff6ff;
  color: #2563eb !important;
  padding: 2px 8px;
  border-radius: 7px;
  min-width: 3rem;
  width: 3rem;
  text-align: center;
  flex-shrink: 0;
}
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-cal-dow, .mini-cal-day { text-align: center; font-size: 10px; color: #94a3b8; }
.mini-cal-day { color: #334155; font-weight: 700; border-radius: 999px; padding: 2px 0; }
.mini-cal-day.active { background: #2563eb; color: #fff; }

.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  text-decoration: none;
  color: #334155;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.nav-link:hover { background: #f1f5f9; }
.nav-link.active { background: #eff6ff; color: #1d4ed8; }

.users-nav { margin-top: 4px; }
.users-toggle {
  border: 0;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
}
.users-toggle:hover { background: #f8fafc; }
.users-subnav { margin-left: 10px; border-left: 1px solid #e2e8f0; padding-left: 8px; display: block; }
.users-subnav .nav-link.sub { font-size: 13px; padding: 8px 10px; }

.sidebar-user { margin-top: auto; border-top: 1px solid #eef2f7; padding-top: 12px; }
.sidebar-user-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.sidebar-logout-btn {
  flex-shrink: 0;
  width: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-logout-btn svg { width: 22px; height: 22px; }
.sidebar-logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.34);
}
.profile-btn {
  flex: 1;
  min-width: 0;
  width: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  cursor: pointer;
}
.profile-btn-copy { min-width: 0; flex: 1; }
.profile-avatar-shell {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #2563eb;
  overflow: hidden;
  flex-shrink: 0;
}
#profileInitial { color: #fff; font-weight: 700; }
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-btn p { margin: 0; text-align: left; }
#profileName { font-size: 13px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#profileRole { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { flex: 1; min-width: 0; }
.app-main { padding: 24px; }

.page-header { margin-bottom: 14px; }
.page-header h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.page-header p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card {
  background: var(--card);
  border: 1px solid #eef2f7;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.card h3 { margin: 0 0 10px; }
.table-card { overflow: auto; }

.btn {
  border: 0;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn.danger { background: var(--danger); }

table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
th { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  background: white;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37, 99, 235, 0.18); border-color: #60a5fa; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }

.badge { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.badge.Pending { background: #fef3c7; color: #92400e; }
.badge.Active { background: #dbeafe; color: #1d4ed8; }
.badge.Processing { background: #ede9fe; color: #6d28d9; }
.badge.Completed { background: #dcfce7; color: #166534; }

#trackingJson { white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }

.banner {
  text-align: left;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  margin: 0 0 10px;
  line-height: 1.4;
}
.banner-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #854d0e; }
.banner-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

@media (max-width: 980px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .app-main { padding: 14px; }
}

/* Enhanced parity UI */
.hero-card {
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(120deg, #0f172a, #132d78 45%, #1e3a8a);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hero-title { margin: 8px 0 0; font-size: 44px; line-height: 1.05; letter-spacing: -0.03em; font-weight: 900; }
.hero-date { margin: 0; color: #bfdbfe; font-weight: 700; font-size: 14px; }
.hero-mini-cards { display: flex; gap: 10px; }
.hero-mini-card { border: 1px solid rgba(255,255,255,0.2); border-radius: 16px; padding: 12px 14px; min-width: 118px; background: rgba(255,255,255,0.08); text-align: center; }
.mini-label { margin: 0; font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: #bfdbfe; font-weight: 700; }
.mini-value { margin: 6px 0 0; font-size: 30px; font-weight: 900; }

.section-head h3 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.section-head p { margin: 2px 0 8px; font-size: 13px; color: #64748b; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat-card { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid #edf2f7; background: #fff; padding: 16px; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.stat-label { text-transform: uppercase; letter-spacing: .14em; color: #94a3b8; font-size: 10px; font-weight: 800; }
.stat-value { margin: 8px 0 2px; font-size: 42px; line-height: 1; letter-spacing: -0.03em; font-weight: 900; }
.stat-sub { font-size: 12px; color: #64748b; margin: 0; }
.stat-bar { margin-top: 10px; height: 3px; border-radius: 999px; }

.dashboard-bottom-grid { display: grid; grid-template-columns: 1fr 180px; gap: 14px; margin-bottom: 14px; }
.summary-stack { display: grid; gap: 10px; }
.summary-item { border-radius: 16px; border: 1px solid #edf2f7; background: #fff; padding: 12px; box-shadow: 0 6px 18px rgba(15,23,42,.05); }
.summary-item h4 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #94a3b8; }
.summary-item p { margin: 6px 0 0; font-size: 30px; line-height: 1; font-weight: 900; }

.map-card .card-head, .upcoming-card .card-head, .tracking-side .card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px;
}
.card-head h3 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.card-head p { margin: 3px 0 0; color: #64748b; font-size: 12px; }
.map-canvas { width: 100%; height: 300px; border-radius: 14px; background: #e2e8f0; border: 1px solid #dbe3ef; }
.tracking-map { height: 420px; }

.btn.btn-dark { background: #0f172a; color: #fff; }
.btn.btn-light { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }

.tracking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tracking-side { display: flex; flex-direction: column; }
.tracking-side .muted { margin: 0 0 10px; color: #64748b; font-size: 14px; }
.empty-state { min-height: 300px; border: 1px dashed #dbe3ef; background: #f8fafc; border-radius: 14px; display: grid; place-items: center; color: #94a3b8; font-weight: 700; }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav h2 { margin: 0; font-size: 34px; letter-spacing: -0.02em; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar-right select {
  width: 110px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  font-weight: 700;
}
#newWorkOrderBtn {
  border-radius: 9px;
  font-size: 14px;
  padding: 10px 16px;
}
.calendar-card { padding: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border: 1px solid #eef2f7; border-radius: 14px; overflow: hidden; }
.cal-head { background: #f8fafc; border-bottom: 1px solid #eef2f7; padding: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #64748b; text-align: center; font-weight: 800; }
.cal-cell { min-height: 96px; border-right: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; padding: 8px; position: relative; background: #fff; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-date { font-size: 12px; font-weight: 700; color: #334155; }
.cal-date.today { display: inline-flex; width: 24px; height: 24px; border-radius: 999px; background: #2563eb; color: #fff; align-items: center; justify-content: center; }
.cal-empty { background: #f8fafc; }
.cal-events { margin-top: 6px; display: grid; gap: 5px; }
.cal-event { font-size: 11px; border-radius: 7px; padding: 3px 6px; color: #fff; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid #eef2f7;
  border-radius: 14px;
  overflow: hidden;
}
.week-col { border-right: 1px solid #eef2f7; min-height: 210px; background: #fff; }
.week-col:last-child { border-right: none; }
.week-col-head {
  border-bottom: 1px solid #eef2f7;
  padding: 8px;
  text-align: center;
}
.week-col-head p { margin: 0 0 4px; font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .1em; }
.week-col-body { padding: 8px; min-height: 150px; display: grid; gap: 5px; align-content: start; }
.calendar-day-grid {
  border: 1px solid #eef2f7;
  border-radius: 14px;
  min-height: 300px;
  background: #fff;
  display: grid;
  place-items: center;
}
.day-empty-state { text-align: center; color: #94a3b8; font-weight: 700; }
.day-empty-state p { margin: 0; color: #94a3b8; }
.day-empty-state small { color: #cbd5e1; }
.day-empty-icon { font-size: 28px; margin-bottom: 8px !important; }
.day-events-list {
  width: 100%;
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.drawer-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.4); z-index: 80;
  backdrop-filter: none;
  opacity: 1;
}
.workorder-drawer {
  position: relative; width: min(860px, 100vw); height: 100vh;
  background: #fff; box-shadow: -8px 0 32px rgba(15,23,42,.12);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(0);
  opacity: 1;
  flex-shrink: 0;
}
.wo-drawer-stage {
  position: fixed; top: 0; right: 0; z-index: 90;
  display: flex; align-items: stretch; height: 100vh;
  pointer-events: none;
}
.wo-drawer-stage:not(.hidden) { pointer-events: auto; }
.wo-drawer-stage .workorder-drawer.hidden { display: none; }
.wo-drawer-stage:not(.hidden) .workorder-drawer:not(.hidden) { display: flex; }

/* Work order drawer — React parity */
.wo-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid #f3f4f6; flex-shrink: 0;
}
.wo-drawer-header h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0f172a;
  line-height: 1.25;
}
.modal-close-btn,
.jha-editor-close,
.wo-close-btn,
.sidebar-close-btn,
.profile-modal-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.12);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.modal-close-btn:hover,
.jha-editor-close:hover,
.wo-close-btn:hover,
.sidebar-close-btn:hover,
.profile-modal-close:hover {
  background: #fecaca;
  border-color: #fca5a5;
  color: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
}
.modal-close-btn:focus-visible,
.jha-editor-close:focus-visible,
.wo-close-btn:focus-visible,
.sidebar-close-btn:focus-visible,
.profile-modal-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.modal-close-btn-icon,
.jha-editor-close-icon,
.wo-close-btn svg,
.sidebar-close-btn svg,
.profile-modal-close svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.wo-drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wo-drawer-body {
  flex: 1; overflow-y: auto; padding: 24px 32px;
  display: flex; flex-direction: column; gap: 26px;
}
.wo-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  padding: 18px;
}
.wo-section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wo-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0f172a;
}
.wo-section-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}
.wo-drawer-footer {
  flex-shrink: 0; padding: 16px 32px; border-top: 1px solid #f3f4f6;
}
.wo-submit-btn {
  width: 100%; border: 0; border-radius: 12px; padding: 12px 16px;
  background: #2563eb; color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.wo-submit-btn:hover { background: #1d4ed8; }
.wo-field { display: flex; flex-direction: column; gap: 8px; }
.wo-label {
  display: block; margin: 0; font-size: 13px; font-weight: 700;
  text-transform: none; letter-spacing: 0.015em; color: #1f2937; line-height: 1.4;
}
.wo-label-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 0;
}
.wo-label-inline {
  font-size: 13px; font-weight: 700; text-transform: none;
  letter-spacing: 0.015em; color: #1f2937; line-height: 1.35;
}
.wo-sublabel { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #1f2937; line-height: 1.35; }
.wo-icon {
  width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: #374151;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.wo-input, .wo-textarea, .wo-select {
  width: 100%; font-size: 16px; font-weight: 500; line-height: 1.45; color: #0f172a; background: #fff;
  border: 1px solid #d1d5db; border-radius: 12px; padding: 13px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.wo-input.is-readonly,
.wo-input:read-only {
  background: #f8fafc;
  color: #334155;
  cursor: default;
}
.wo-input.is-readonly:focus,
.wo-input:read-only:focus {
  border-color: #d1d5db;
  box-shadow: none;
}
.wo-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}
.wo-input:focus, .wo-textarea:focus, .wo-select:focus {
  outline: none; border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.wo-input::placeholder, .wo-textarea::placeholder { color: #94a3b8; }
.wo-textarea { resize: none; line-height: 1.5; min-height: 0; }
.wo-title-input { font-size: 19px; font-weight: 600; line-height: 1.4; min-height: 88px; letter-spacing: -0.01em; }
.wo-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wo-grid-tight { gap: 12px; }
.wo-submitted-time-row { max-width: 460px; }
.wo-select-wrap { position: relative; }
.wo-select { appearance: none; padding-right: 40px; cursor: pointer; }
.wo-chevron {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: #9ca3af;
  stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.wo-hint { margin: 0 0 6px; font-size: 12px; color: #475569; line-height: 1.5; }
.technician-media-card {
  margin: 0;
}
.modal-form.entity-form > .technician-media-card,
.modal-form.entity-form > .wo-media-card {
  margin-left: 20px;
  margin-right: 20px;
  margin-top: 14px;
  margin-bottom: 0;
}
.modal-form.entity-form > .technician-media-card + .entity-section,
.modal-form.entity-form > .wo-media-card + .entity-section {
  margin-top: 14px;
}
.technician-media-card .vendor-attachments-list,
.technician-media-card .technician-attachments-list {
  margin-top: 12px;
}
.technician-profile-grid:empty {
  display: none;
}
.technician-profile-thumb {
  max-width: 140px;
}
.employee-row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.wo-spacer { height: 16px; }

/* Color swatches */
.wo-color-field { align-items: flex-start; }
.wo-color-swatches { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2px; }
.wo-color-swatch {
  width: 40px; height: 40px; border-radius: 999px; border: 2px solid #fff;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: transform .15s, box-shadow .15s;
  opacity: .92;
}
.wo-color-swatch:hover { transform: scale(1.05); }
.wo-color-swatch.active {
  border-color: #111827; transform: scale(1.1);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}

/* Sub work orders box */
.wo-sub-box {
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px;
}
.wo-sub-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.wo-sub-title {
  margin: 0; font-size: 13px; font-weight: 700; text-transform: none;
  letter-spacing: 0.015em; color: #334155; line-height: 1.35;
}
.wo-sub-hint { font-size: 12px; color: #64748b; line-height: 1.45; }
.wo-sub-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wo-sub-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #f9fafb; border-radius: 6px; padding: 8px 12px;
}
.wo-sub-item-left { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #374151; }
.wo-sub-item-left svg { width: 14px; height: 14px; stroke: #9ca3af; fill: none; stroke-width: 2; }
.wo-sub-remove {
  border: 0; background: transparent; color: #9ca3af; cursor: pointer; padding: 4px;
}
.wo-sub-remove:hover { color: #ef4444; }
.wo-sub-remove svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.wo-link-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  color: #2563eb; font-size: 16px; font-weight: 600; cursor: pointer; padding: 0;
}
.wo-link-btn:hover { color: #1d4ed8; }
.wo-link-btn svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}
.wo-link-btn.is-disabled,
.wo-link-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
}

/* Searchable selects */
.wo-search-select,
.wo-ss-root { position: relative; }
.wo-search-select .wo-ss-trigger,
.wo-ss-root .wo-ss-trigger {
  width: 100%; text-align: left; font-size: 16px; font-weight: 500; line-height: 1.45; color: #0f172a;
  background: #fff; border: 1px solid #d1d5db; border-radius: 12px;
  padding: 12px 40px 12px 16px; cursor: pointer; position: relative;
}
.wo-search-select .wo-ss-trigger.placeholder,
.wo-ss-root .wo-ss-trigger.placeholder { color: #9ca3af; }
.wo-search-select .wo-ss-trigger::after,
.wo-ss-root .wo-ss-trigger::after {
  content: ""; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid #9ca3af;
}
.wo-search-select.has-clear .wo-ss-trigger,
.wo-ss-root.has-clear .wo-ss-trigger {
  padding-right: 60px;
}
.wo-ss-clear {
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.wo-ss-clear:hover {
  background: #cbd5e1;
  color: #0f172a;
}
.wo-ss-option.wo-ss-clear-option {
  font-weight: 700;
  color: #b91c1c;
  border-bottom: 1px solid #f1f5f9;
}
.wo-ss-option.wo-ss-clear-option:hover {
  background: #fef2f2;
  color: #991b1b;
}
.wo-ss-option.is-selected {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.wo-search-select.open .wo-ss-dropdown,
.wo-ss-root.open .wo-ss-dropdown {
  display: block;
}
.wo-search-select.is-disabled,
.wo-ss-root.is-disabled {
  pointer-events: none;
  opacity: 0.92;
}
.wo-search-select.is-disabled .wo-ss-trigger,
.wo-ss-root.is-disabled .wo-ss-trigger {
  background: #f8fafc;
  cursor: default;
}
.wo-ss-dropdown {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12); z-index: 40; overflow: hidden;
}
.wo-ss-dropdown.wo-ss-dropdown-portal {
  display: none;
  position: fixed;
  left: auto;
  right: auto;
  top: auto;
  z-index: 1300;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
.wo-ss-dropdown.wo-ss-dropdown-portal.is-open {
  display: block;
}
.modal-form .entity-field:has(.wo-search-select.open),
.modal-form .entity-field:has(.wo-ss-root.open),
.wo-drawer-form .wo-field:has(.wo-search-select.open) {
  position: relative;
  z-index: 45;
}
.wo-ss-search {
  width: 100%; border: 0; border-bottom: 1px solid #f3f4f6; padding: 10px 14px;
  font-size: 14px; outline: none;
}
.wo-ss-options { max-height: 200px; overflow-y: auto; }
.wo-ss-option {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; background: #fff;
  padding: 10px 14px; font-size: 14px; color: #374151; cursor: pointer;
}
.wo-ss-option:hover, .wo-ss-option.highlight { background: #eff6ff; color: #1d4ed8; }
.wo-ss-option .wo-ss-check {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  pointer-events: none;
}
.wo-ss-option .wo-ss-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #2563eb;
  pointer-events: none;
}
.wo-ss-option .wo-ss-option-label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}
.wo-ss-option.wo-ss-select-all {
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}
.wo-ss-option.wo-ss-select-all:hover,
.wo-ss-option.wo-ss-select-all.highlight {
  background: #eff6ff;
  color: #1d4ed8;
}
.wo-ss-option.wo-ss-create {
  font-weight: 700;
  color: #2563eb;
  border-top: 1px solid #f1f5f9;
}
.wo-ss-empty { padding: 12px 14px; font-size: 13px; color: #9ca3af; line-height: 1.45; }
.wo-ss-empty.wo-ss-empty-center {
  text-align: center;
  padding: 16px 18px;
}
.wo-ss-empty.wo-ss-empty-near {
  text-align: center;
  color: #dc2626;
  font-weight: 500;
  padding: 16px 14px;
}
.wo-vendor-location-notice {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}
.wo-vendor-location-notice.is-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.wo-vendor-scope-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}
.wo-vendor-scope-link {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wo-vendor-scope-link:hover {
  color: #1d4ed8;
}
.currency-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.currency-input-prefix {
  position: absolute;
  left: 14px;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
}
.currency-input-wrap input {
  width: 100%;
  padding-left: 30px !important;
}
.wo-ss-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wo-ss-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eff6ff; color: #1d4ed8; border-radius: 999px;
  padding: 4px 10px; font-size: 13px; font-weight: 600;
}
.wo-ss-tag button {
  border: 0;
  background: #bfdbfe;
  color: #1e3a8a;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 15px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.wo-ss-tag button:hover { background: #93c5fd; color: #1e3a8a; }

/* Priority & status pills */
.wo-pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.wo-pill {
  border: 1px solid #cbd5e1; border-radius: 999px; padding: 9px 18px;
  font-size: 14px; font-weight: 700; background: #ffffff; color: #475569;
  cursor: pointer; transition: all .15s;
}
.wo-pill:hover:not(.active) { background: #f1f5f9; border-color: #94a3b8; color: #334155; }
.wo-pill.active[data-value="None"] { background: #4b5563; color: #fff; border-color: #4b5563; }
.wo-pill.active[data-value="Low"] { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.wo-pill.active[data-value="Medium"] { background: #eab308; color: #fff; border-color: #eab308; }
.wo-pill.active[data-value="High"] { background: #ef4444; color: #fff; border-color: #ef4444; }
.wo-pill.wo-priority.active[data-value="S1|S2"] { background: #ef4444; color: #fff; border-color: #ef4444; }
.wo-pill.wo-priority.active[data-value="S3"] { background: #eab308; color: #fff; border-color: #eab308; }
.wo-pill.wo-priority.active[data-value="S4|S5"] { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.wo-close-card .wo-close-checklist {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.wo-close-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  line-height: 1.4;
}
.wo-close-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary, #2563eb);
}
.wo-workflow-card .wo-outcome-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wo-workflow-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.wo-workflow-panel.hidden { display: none; }
.wo-workflow-callout {
  margin: 0 0 10px;
  font-size: 14px;
  color: #334155;
}
.wo-workflow-link {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}
.wo-workflow-link:hover { text-decoration: underline; }
.wo-proposal-rates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.wo-proposal-rates-grid span {
  display: block;
  font-size: 12px;
  color: #64748b;
}
.wo-proposal-rates-grid strong {
  font-size: 15px;
  color: #0f172a;
}
.wo-close-check-nested {
  margin-top: 8px;
}
.wo-workflow-close-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}
.wo-workflow-close-status.is-closed {
  color: #15803d;
  font-weight: 600;
}
.wo-pill.wo-outcome.active[data-value="job_completed"] { background: #16a34a; color: #fff; border-color: #16a34a; }
.wo-pill.wo-outcome.active[data-value="return_trip_needed"] { background: #d97706; color: #fff; border-color: #d97706; }
.wo-pill.wo-outcome.active[data-value="parts_needed"] { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.wo-pill.wo-outcome.active[data-value="proposal_needed"] { background: #2563eb; color: #fff; border-color: #2563eb; }

.wo-ss-option-main {
  display: block;
  font-weight: 500;
  text-align: left;
}
.wo-ss-option-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
  text-align: left;
  line-height: 1.35;
}
.wo-view-close-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wo-view-close-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #334155;
}
.wo-view-close-item.is-checked {
  font-weight: 600;
  color: #0f172a;
}
.wo-view-close-mark {
  display: inline-flex;
  width: 18px;
  justify-content: center;
  font-size: 13px;
}
/* Unique solid palette — one color per workflow status (aliases share intentionally). */
.wo-status.active[data-value="Pending"],
.wo-status.active[data-value="Pending Approval"],
.wo-status.active[data-value="Open"] { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.wo-status.active[data-value="Need Vendor"] { background: #ea580c; color: #fff; border-color: #ea580c; }
.wo-status.active[data-value="Scheduling with Vendor"],
.wo-status.active[data-value="Assigned to Vendor"] { background: #0284c7; color: #fff; border-color: #0284c7; }
.wo-status.active[data-value="Proposal Needed"],
.wo-status.active[data-value="Need Proposal"] { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.wo-status.active[data-value="Proposal Sent"] { background: #c026d3; color: #fff; border-color: #c026d3; }
.wo-status.active[data-value="Waiting for Approval"] { background: #ca8a04; color: #fff; border-color: #ca8a04; }
.wo-status.active[data-value="Proposal Not Approved"] { background: #dc2626; color: #fff; border-color: #dc2626; }
.wo-status.active[data-value="Proposal – Approved"],
.wo-status.active[data-value="Proposal Approved"] { background: #0d9488; color: #fff; border-color: #0d9488; }
.wo-status.active[data-value="Approved – Needs Scheduling"],
.wo-status.active[data-value="Approved Need to Scheduled"],
.wo-status.active[data-value="Need to schedule"],
.wo-status.active[data-value="Need To Schedule"] { background: #059669; color: #fff; border-color: #059669; }
.wo-status.active[data-value="Active"],
.wo-status.active[data-value="Scheduled"] { background: #2563eb; color: #fff; border-color: #2563eb; }
.wo-status.active[data-value="Approved – Waiting for Parts"] { background: #e11d48; color: #fff; border-color: #e11d48; }
.wo-status.active[data-value="Processing"],
.wo-status.active[data-value="In Progress"] { background: #9333ea; color: #fff; border-color: #9333ea; }
.wo-status.active[data-value="Completed – Invoice Needed"],
.wo-status.active[data-value="Work Completed Need to Invoice"] { background: #a16207; color: #fff; border-color: #a16207; }
.wo-status.active[data-value="Completed – Bill for Incurred Costs"] { background: #b45309; color: #fff; border-color: #b45309; }
.wo-status.active[data-value="Completed – Vendor Payment Needed"] { background: #be185d; color: #fff; border-color: #be185d; }
.wo-status.active[data-value="Completed – Vendor Paid"],
.wo-status.active[data-value="Invoiced"] { background: #65a30d; color: #fff; border-color: #65a30d; }
.wo-status.active[data-value="Completed – Need to send Uplift"] { background: #c2410c; color: #fff; border-color: #c2410c; }
.wo-status.active[data-value="Uplift Send"] { background: #0f766e; color: #fff; border-color: #0f766e; }
.wo-status.active[data-value="Completed"],
.wo-status.active[data-value="Complete"] { background: #15803d; color: #fff; border-color: #15803d; }
.wo-status.active[data-value="Canceled"],
.wo-status.active[data-value="Cancelled"] { background: #64748b; color: #fff; border-color: #64748b; }

/* Work order destination map picker */
.wo-destination-selected-address {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}
.pac-container {
  z-index: 140 !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
}
.wo-destination-map-overlay {
  z-index: 120;
}
.wo-destination-map-modal {
  z-index: 121;
  max-width: min(760px, calc(100vw - 24px));
}
.wo-destination-modal-copy {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}
.wo-destination-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 28px 20px;
}
.wo-destination-modal-footer {
  justify-content: flex-end;
  gap: 10px;
}
.wo-destination-field { position: relative; }
.wo-destination-trigger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  cursor: pointer;
  color: #94a3b8;
}
.wo-destination-trigger.has-value,
.wo-destination-trigger.has-value #woDestinationLabel {
  color: #0f172a;
  font-weight: 600;
}
.wo-destination-map {
  width: 100%;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.wo-destination-hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

/* Attachments */
.wo-attachments-card,
.wo-media-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.wo-media-card { margin-bottom: 16px; }
.wo-attachments-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.wo-attachments-card-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: #2563eb;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wo-attachments-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.wo-attachments-card-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
}
.wo-attachments-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wo-attachment-item {
  display: flex; align-items: center; gap: 12px; background: #f9fafb;
  border: 1px solid #eef2f7;
  border-radius: 10px; padding: 10px 12px;
}
.wo-attachment-item.is-image { padding: 8px 12px; }
.wo-attachment-item--file {
  flex-wrap: wrap;
}
.wo-attachment-item--file .communication-file-chip {
  flex: 1 1 auto;
  min-width: 0;
}
.wo-attachment-item--file .wo-attachment-size {
  margin: 0;
  flex: 0 0 auto;
}
.wo-attachment-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
  cursor: zoom-in;
  background: #eff6ff;
}
.wo-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wo-attachment-item > svg,
.wo-attachment-item svg.file-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: #9ca3af;
  fill: none;
  stroke-width: 2;
}
.wo-attachment-meta { flex: 1; min-width: 0; }
.wo-attachment-name { margin: 0; font-size: 14px; font-weight: 600; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-attachment-size { margin: 0; font-size: 12px; color: #6b7280; }

.wo-checklist-open-wrap {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
/* Must beat .jha-editor (1210) and the overlay (1250) so clicks reach the form. */
#woChecklistEditorOverlay.jha-editor-overlay {
  z-index: 1250;
}
#woChecklistEditorCard.jha-editor.wo-checklist-editor {
  z-index: 1260;
  pointer-events: auto;
}
.wo-checklist-editor .jha-editor-footer {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  flex-shrink: 0;
}
.wo-checklist-pdf-wrap { margin-top: 12px; }
.wo-checklist-pdf-card {
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: #f9fafb;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 8px;
}
.wo-checklist-pdf-open {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.wo-checklist-pdf-open:hover { background: #eff6ff; }
.wo-checklist-pdf-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #fee2e2;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wo-checklist-pdf-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.wo-checklist-pdf-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wo-checklist-pdf-copy strong {
  font-size: 14px;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wo-checklist-pdf-copy span {
  font-size: 12px;
  color: #6b7280;
}
.wo-checklist-pdf-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.wo-checklist-pdf-download:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.wo-checklist-pdf-download svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.wo-checklist-pdf-remove {
  flex-shrink: 0;
  align-self: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.wo-checklist-pdf-remove:hover {
  color: #ef4444;
  background: #fef2f2;
}
#woChecklistClearBtn {
  color: #b91c1c;
  border-color: #fecaca;
}
.wo-checklist-pdf-card-view {
  margin-top: 12px;
}
.wo-attachment-remove {
  border: 0; background: transparent; color: #9ca3af; cursor: pointer; padding: 4px;
  font-size: 18px; line-height: 1;
}
.wo-attachment-remove:hover { color: #ef4444; }
.wo-upload-link {
  display: inline-flex; align-items: center; gap: 8px; color: #2563eb;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.wo-upload-link:hover { color: #1d4ed8; }
.wo-upload-link.is-disabled,
.wo-upload-link[aria-disabled="true"] {
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
}
.wo-upload-link.is-disabled:hover,
.wo-upload-link[aria-disabled="true"]:hover {
  color: #94a3b8;
}
.wo-upload-link svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}
.wo-upload-link .hidden { display: none; }
.part-image-thumb,
.wo-view-image-thumb,
.part-view-thumb {
  cursor: zoom-in;
}
.part-image-thumb img,
.wo-view-image-thumb img,
.part-view-thumb img {
  cursor: zoom-in;
}
.image-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  z-index: 1400;
}
.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1401;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
}
.image-preview-modal.hidden,
.image-preview-overlay.hidden {
  display: none !important;
}
.image-preview-stage {
  position: relative;
  width: min(920px, calc(100vw - 48px));
  height: min(78vh, 820px);
  flex-shrink: 0;
  z-index: 1;
}
.image-preview-frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  background: #0b1220;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.45);
}
.image-preview-frame.is-filled .image-preview-media:not(.hidden) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-preview-modal img.image-preview-media,
.image-preview-pdf {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform-origin: center center;
  transition: transform 0.2s ease;
}
.image-preview-pdf {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
.image-preview-media.hidden,
.image-preview-download.hidden,
.image-preview-icon-pause.hidden,
.image-preview-icon-play.hidden {
  display: none !important;
}
.image-preview-fallback {
  display: none;
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.image-preview-fallback.is-visible {
  display: flex;
}
.image-preview-fallback p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.image-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  pointer-events: auto;
}
.image-preview-close:hover {
  background: #fff;
}
.image-preview-controls {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}
.image-preview-controls.is-single .image-preview-nav-only {
  display: none;
}
.image-preview-tool {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.image-preview-tool:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}
.image-preview-tool:disabled {
  opacity: 0.35;
  cursor: default;
}
.image-preview-tool svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.image-preview-tool .image-preview-icon-play {
  fill: currentColor;
  stroke: none;
}
.image-preview-tool-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.22);
}
.image-preview-caption {
  margin: 0;
  max-width: min(920px, calc(100vw - 48px));
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.image-preview-caption.hidden {
  display: none !important;
}
.image-preview-download {
  /* inherits .image-preview-tool */
}
.wo-media-card .wo-image-dropzone { margin-top: 0; }
.wo-media-card .part-images-grid,
.wo-media-card .wo-images-grid { margin-top: 12px; }
.wo-image-dropzone {
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.wo-image-dropzone:hover {
  background: #e0edff;
}
.wo-image-dropzone.dragover {
  border-color: #2563eb;
  background: #dbeafe;
  transform: translateY(-1px);
}
.wo-image-dropzone.is-disabled,
.wo-image-dropzone[aria-disabled="true"] {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
}
.wo-image-drop-icon {
  font-size: 20px;
  line-height: 1;
}
.wo-image-drop-text {
  font-size: 16px;
  font-weight: 700;
}

/* Asset picker dialog */
.wo-asset-dialog {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: #fff; border-radius: 12px;
  box-shadow: 0 24px 48px rgba(15,23,42,.2); z-index: 95; overflow: hidden;
  display: flex; flex-direction: column;
}
.wo-asset-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid #f3f4f6;
}
.wo-asset-head h3 { margin: 0; font-size: clamp(24px, 2.4vw, 38px); font-weight: 700; letter-spacing: -0.02em; color: #111827; }
.wo-asset-search-wrap { position: relative; padding: 16px 24px 0; }
.wo-search-icon {
  position: absolute; left: 36px; top: calc(50% + 8px); transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: #9ca3af; stroke-width: 2;
}
.wo-asset-search-wrap .wo-input { padding-left: 36px; font-size: clamp(16px, 1.5vw, 24px); border-radius: 8px; padding-top: 8px; padding-bottom: 8px; }
.wo-asset-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 24px 0; }
.wo-filter-pill {
  border: 1px solid #dbe2ea; border-radius: 8px; background: #fff;
  color: #0f172a; font-weight: 600; font-size: 14px; padding: 8px 12px; cursor: pointer;
}
.wo-filter-pill:hover { background: #f8fafc; border-color: #cbd5e1; }
.wo-filter-add { color: #2563eb; }
.wo-filter-panel {
  position: absolute;
  top: 170px;
  left: 24px;
  width: min(420px, calc(100% - 48px));
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.08); max-height: 260px; overflow: auto;
  z-index: 8;
}
#woAssetFilterPanel { left: 120px; }
.wo-filter-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; font-weight: 700; color: #334155;
}
.wo-filter-clear { border: 0; background: transparent; color: #2563eb; font-size: 13px; font-weight: 700; cursor: pointer; }
.wo-filter-panel-list { display: flex; flex-direction: column; padding: 8px; gap: 4px; }
.wo-filter-option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px;
  font-size: 14px; color: #334155; cursor: pointer;
}
.wo-filter-option:hover { background: #f8fafc; }
.wo-filter-option input { accent-color: #2563eb; }
.wo-filter-option-label { flex: 1; min-width: 0; text-align: left; }
.wo-filter-empty { margin: 0; padding: 10px 12px; color: #94a3b8; font-size: 13px; }
.wo-asset-info {
  margin: 10px 24px 0; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 10px; color: #1d4ed8; font-size: 14px; font-weight: 600; padding: 10px 12px;
}
.wo-asset-list {
  flex: 1; min-height: 220px; overflow-y: auto; padding: 12px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.wo-asset-option {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px;
  border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-size: 14px; color: #374151;
}
.wo-asset-option:hover { background: #f9fafb; border-color: #cbd5e1; }
.wo-asset-option input { accent-color: #2563eb; margin-top: 2px; flex-shrink: 0; }
.wo-asset-option-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, max-content);
  align-items: center;
  column-gap: 14px;
  width: 100%;
  min-width: 0;
}
.wo-asset-option-name {
  color: #1f2937; font-weight: 600; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wo-asset-option-meta { color: #64748b; font-size: 12px; font-weight: 600; text-align: right; white-space: nowrap; }
.wo-asset-foot {
  display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid #f3f4f6;
}
.wo-asset-selected { margin: 0; color: #334155; font-size: 14px; font-weight: 600; flex: 1; }
.wo-btn-secondary {
  border: 0; border-radius: 12px; padding: 10px 14px; background: #f3f4f6;
  color: #374151; font-weight: 700; font-size: 14px; cursor: pointer;
}
.wo-btn-secondary:hover { background: #e5e7eb; }
.wo-btn-primary {
  border: 0; border-radius: 12px; padding: 10px 14px; background: #2563eb;
  color: #fff; font-weight: 700; font-size: 14px; cursor: pointer;
}
.wo-btn-primary:hover { background: #1d4ed8; }
.wo-btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; }

.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.muted-label { margin: 2px 0 -2px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #64748b; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e2e8f0; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; background: #f8fafc; }

.toolbar-grid { grid-template-columns: 120px 1fr 180px !important; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 80; }
.modal-card {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 20px)); max-height: 90vh; background: #fff; border-radius: 20px; z-index: 90;
  border: 1px solid #e5e7eb; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
}
/* Finance + proposal popups on work-order show must sit above the edit drawer host. */
#woProposalModalOverlay,
#vendorBillingOverlay,
#amazonBillingOverlay,
#woShowProposalOverlay {
  z-index: 1220;
}
#woProposalModal,
#vendorBillingModal,
#amazonBillingModal,
#woShowProposalEditor {
  z-index: 1230;
}
#woShowProposalEditor.jha-editor {
  z-index: 1230;
}
/* Rate history cards must sit above Cost Management on every page (incl. WO view). */
#woVendorRatePopupOverlay,
#woAmazonRatePopupOverlay {
  z-index: 1240;
}
#woVendorRatePopup,
#woAmazonRatePopup {
  z-index: 1250;
}
.modal-top-line { height: 8px; background: #2563eb; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}
.modal-header h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.015em; color: #0f172a; }
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
}
.modal-form.entity-form:not(:has(.modal-form-body)) {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-form.entity-form:has(.modal-form-body) {
  overflow: hidden;
}
.modal-form-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.modal-form.entity-form > .modal-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 6;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
}
.qr-preview { border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px; width: fit-content; background: #fff; }
.qr-preview img { width: 180px; height: 180px; display: block; }

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero-card { flex-direction: column; align-items: flex-start; }
  .hero-title { font-size: 32px; }
  .tracking-grid { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .toolbar-grid { grid-template-columns: 1fr !important; }
  .page-hero-card { flex-direction: column; align-items: stretch; }
  .page-hero-actions { flex-wrap: wrap; }
  .access-grid { grid-template-columns: 1fr; }
  .modal-form.entity-form > .entity-section,
  .modal-form.entity-form > .access-tip,
  .modal-form-body > .entity-section,
  .modal-form.entity-form > .entity-field,
  .modal-form-body > .entity-field,
  .modal-form.entity-form > .technician-media-card,
  .modal-form.entity-form > .wo-media-card {
    margin-left: 16px;
    margin-right: 16px;
  }
  .modal-form.entity-form > .entity-section:first-of-type,
  .modal-form.entity-form > input[type="hidden"] + .entity-section,
  .modal-form-body > .entity-section:first-of-type,
  .modal-form.entity-form > .entity-field:first-of-type,
  .modal-form-body > .entity-field:first-of-type {
    margin-top: 16px;
  }
  .modal-footer {
    padding: 14px 16px 18px;
  }
}

/* React-parity components */
.page-hero-card {
  position: relative;
  z-index: 40;
  background: #fff;
  border-radius: 40px;
  border: 1px solid #f3f4f6;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 28px 32px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.page-hero-card h2 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.page-hero-card p { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.page-hero-actions { display: flex; align-items: center; gap: 10px; }
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-wrap input {
  width: 100%;
  border: 0;
  background: #f9fafb;
  border-radius: 16px;
  padding: 14px 14px 14px 42px;
  font-weight: 700;
  font-size: 14px;
}
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .45; }
.sort-select {
  width: auto;
  border: 0;
  background: #f9fafb;
  border-radius: 16px;
  padding: 14px 36px 14px 14px;
  font-weight: 700;
  font-size: 14px;
}
.page-hero-actions .sort-select.wo-search-select {
  min-width: 132px;
  display: inline-block;
  padding: 0;
  background: transparent;
}
.page-hero-actions .sort-select.wo-search-select .wo-ss-trigger {
  min-height: 44px;
  min-width: 132px;
  padding: 14px 36px 14px 14px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 16px;
  border: 0;
  background: #f9fafb;
}
.page-hero-actions .sort-select.wo-search-select .wo-ss-trigger:hover {
  background: #fff;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}
.page-hero-actions .sort-select.wo-search-select.open .wo-ss-trigger {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.page-hero-actions .sort-select.wo-search-select .wo-ss-dropdown {
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
.page-hero-actions .sort-select.wo-search-select .wo-ss-option {
  padding: 11px 14px;
  font-weight: 600;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 30px rgba(37, 99, 235, 0.18); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-pill { border-radius: 16px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 900; padding: 14px 22px; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
.btn-icon { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: #6b7280; }

.table-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.table-panel.is-loading {
  min-height: min(52vh, 420px);
}
.table-panel.is-loading > :not(.page-orbit-loader) {
  visibility: hidden;
  pointer-events: none;
}
.table-panel.is-loading > .page-orbit-loader {
  display: grid !important;
}
.table-scroll { flex: 1; min-height: 0; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(249, 250, 251, 0.95);
  backdrop-filter: blur(4px);
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
}
.data-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}
.data-table tbody tr:hover { background: rgba(248, 250, 252, 0.8); }
.empty-cell { text-align: center; color: #9ca3af; padding: 48px 16px !important; font-weight: 600; }

/* Shared CRUD table Actions column (sticky right, like WO list) */
.data-table th.col-name,
.data-table td.col-name {
  width: 30%;
  min-width: 160px;
}
.data-table th.col-description,
.data-table td.col-description {
  width: auto;
}
.data-table td.col-name,
.data-table td.col-description {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table th.col-actions,
.data-table td.col-actions {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  text-align: center;
  padding-left: 8px;
  padding-right: 16px;
  position: sticky;
  right: 0;
  z-index: 2;
  overflow: visible;
  background: #fff;
  box-shadow: -8px 0 12px -10px rgba(15, 23, 42, 0.35);
  white-space: nowrap;
}
.data-table thead th.col-actions {
  z-index: 3;
  background: rgba(249, 250, 251, 0.98);
  box-shadow:
    inset 0 -1px 0 #e5e7eb,
    -8px 0 12px -10px rgba(15, 23, 42, 0.35);
}
.data-table tbody tr:hover td.col-actions {
  background: #f8fafc;
}
.data-table td.col-actions .row-actions {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
}

/* Work order list (Preventive / Reactive) */
.calendar-page--list {
  gap: 16px;
  min-height: 0;
  height: 100%;
}
.wo-list-hero {
  overflow: visible;
  position: relative;
  /* Above sticky list thead (z-index 5–7) so Filters popover is never covered. */
  z-index: 40;
}
.wo-list-hero .btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 14px;
  border-radius: 12px;
  min-height: 44px;
  height: 44px;
  padding: 0 18px;
  box-sizing: border-box;
}
.wo-list-hero .btn-pill svg {
  width: 16px;
  height: 16px;
}
.wo-list-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.wo-list-hero-actions > * {
  flex-shrink: 0;
}
.wo-list-hero-search {
  min-width: min(260px, 70vw);
  display: flex;
  align-items: center;
  height: 44px;
}
.wo-list-hero-search input {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  border-radius: 12px;
  font-weight: 600;
  box-sizing: border-box;
}
.wo-list-period-filters {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  height: 44px;
}
.wo-list-period-filters .wo-search-select {
  min-width: 120px;
  width: 120px;
}
.wo-list-period-filters .wo-search-select .wo-ss-trigger {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 600;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}
.wo-list-period-filters .wo-search-select.is-disabled .wo-ss-trigger {
  opacity: 0.55;
  cursor: not-allowed;
}
.wo-list-filter-wrap {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 44px;
}
.wo-list-filter-wrap.is-open {
  z-index: 90;
}
.wo-list-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  box-sizing: border-box;
}
.wo-list-filter-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.wo-list-io-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  box-sizing: border-box;
}
.wo-list-io-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.wo-list-io-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.wo-list-filter-btn.has-filters {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.wo-list-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.wo-list-filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(520px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  z-index: 100;
  isolation: isolate;
}
.wo-list-filter-popover:has(.vendors-filters-grid) {
  width: min(580px, calc(100vw - 32px));
}
.wo-list-filter-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.wo-list-filter-popover-head strong {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.wo-list-filter-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.wo-list-filter-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.wo-list-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.wo-list-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.wo-list-field > span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.wo-list-field input[type="date"],
.wo-list-field input.bs-us-date-display {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.wo-list-field input[type="date"]:hover,
.wo-list-field input.bs-us-date-display:hover,
.wo-list-field input[type="date"]:focus,
.wo-list-field input.bs-us-date-display:focus {
  outline: none;
  box-shadow: none;
}
.wo-list-field .bs-us-date-field {
  min-height: 44px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}
.wo-list-field .bs-us-date-field:focus-within {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.wo-list-field .bs-us-date-field:hover {
  border-color: #cbd5e1;
  background: #fff;
}
.bs-us-date-field {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.bs-us-date-field:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.bs-us-date-field-inline {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.bs-us-date-field-checklist {
  border: none;
  border-bottom: 1px solid #111;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  gap: 6px;
}
.bs-us-date-field-checklist:focus-within {
  border-bottom-color: #111;
  box-shadow: none;
}
.bs-us-date-field > input.bs-us-date-display {
  flex: 1;
  min-width: 0;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent;
}
.wo-field .bs-us-date-field > input.bs-us-date-display.wo-input,
.wo-input.bs-us-date-display {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent;
  padding: 13px 16px;
}
.wo-field .bs-us-date-field > input.bs-us-date-display.wo-input:focus,
.wo-input.bs-us-date-display:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none;
}
.wo-field .bs-us-date-field-wo {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.wo-field .bs-us-date-field-wo:focus-within {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.wo-field .bs-us-date-field-wo .bs-us-date-picker-btn {
  background: #fff;
}
.bs-us-date-picker-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-radius: 0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  padding: 0;
}
.bs-us-date-picker-btn:hover {
  background: #eef2ff;
  color: #1d4ed8;
}
.bs-us-date-picker-btn-checklist {
  width: 24px;
  min-height: 0;
  height: auto;
  align-self: center;
  border: none;
  background: transparent;
  color: #64748b;
  padding: 0;
}
.bs-us-date-picker-btn-checklist:hover {
  background: transparent;
  color: #1d4ed8;
}
.bs-us-date-picker-btn svg {
  width: 18px;
  height: 18px;
}
.bs-us-date-picker-btn-checklist svg {
  width: 16px;
  height: 16px;
}
input.bs-us-date-iso {
  display: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.checklist-field-date .bs-us-date-display {
  padding: 4px 0;
  font-size: 11px;
  min-height: 0;
}
.checklist-field-date input.bs-us-date-iso,
.checklist-field-date input[type="date"] {
  display: none !important;
}
input.bs-us-date-display {
  width: 100%;
}
input.bs-us-date-display.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
input.bs-us-date-display::placeholder {
  color: #94a3b8;
  font-weight: 500;
}
.wo-input.bs-us-date-display,
.entity-form input.bs-us-date-display,
.modal-form input.bs-us-date-display {
  font-variant-numeric: tabular-nums;
}
.prop-date-picker-wrap input.bs-us-date-display {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 4px 8px;
  background: transparent;
  color: #000;
  cursor: text;
  width: 140px;
  min-height: 32px;
  flex: 1;
  min-width: 0;
}
.prop-date-picker-wrap input.bs-us-date-display:focus {
  background: #f0f4ff;
}
.wo-list-filter-popover .wo-search-select .wo-ss-trigger,
.wo-list-per-page-select .wo-ss-trigger {
  min-height: 44px;
  padding: 10px 40px 10px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 12px;
  border-color: #e2e8f0;
  background: #f8fafc;
}
.wo-list-filter-popover .wo-search-select .wo-ss-trigger:hover,
.wo-list-per-page-select .wo-ss-trigger:hover {
  border-color: #cbd5e1;
  background: #fff;
}
.wo-list-filter-popover .wo-search-select.open .wo-ss-trigger,
.wo-list-per-page-select.open .wo-ss-trigger {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.wo-list-filter-popover .wo-search-select .wo-ss-dropdown,
.wo-list-per-page-select .wo-ss-dropdown {
  z-index: 90;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
.wo-list-filter-popover .wo-search-select .wo-ss-search {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  background: #f8fafc;
}
.wo-list-filter-popover .wo-search-select .wo-ss-option,
.wo-list-per-page-select .wo-ss-option {
  padding: 11px 14px;
  font-weight: 600;
}
.wo-list-filter-popover .wo-search-select .wo-ss-tags {
  margin-bottom: 6px;
  max-height: 88px;
  overflow-y: auto;
}
.wo-list-filter-popover .wo-search-select .wo-ss-tag {
  max-width: 100%;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wo-list-field:has(.wo-search-select.open),
.wo-list-per-page:has(.wo-search-select.open) {
  position: relative;
  z-index: 95;
}
.wo-list-filters-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 14px;
}
.wo-list-filters-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}
.wo-list-per-page-select {
  min-width: 88px;
  display: inline-block;
}
.wo-list-per-page-select .wo-ss-trigger {
  min-height: 38px;
  min-width: 88px;
  padding: 8px 36px 8px 12px;
  background: #fff;
}
.wo-list-filters-actions .btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.wo-list-panel {
  flex: 1 1 0;
  min-height: 0;
}
.wo-list-panel.is-loading .table-scroll {
  opacity: 0.55;
  pointer-events: none;
}
.wo-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.wo-list-per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.wo-list-summary {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.wo-list-panel .table-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.wo-list-table {
  width: 100%;
  /* Preventive list has 4 date cols; keep room for "Aug 28 2026" without clipping. */
  min-width: 2080px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.wo-list-table thead tr {
  background: #f9fafb;
}
.wo-list-table th {
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: bottom;
  padding: 10px 12px;
  position: sticky;
  top: 0;
  /* Above row select clear (×) / chips so sticky header never gets covered on scroll. */
  z-index: 5;
  background: #f9fafb;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #e5e7eb;
  backdrop-filter: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-list-table td {
  vertical-align: middle;
  padding: 10px 12px;
  white-space: nowrap;
  overflow: hidden;
  background: #fff;
  background-clip: padding-box;
}
.wo-list-table tbody tr:hover td {
  background: #f8fafc;
}
.wo-list-table .wo-list-cell-clip,
.wo-list-table .wo-list-title-cell {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wo-list-table .wo-list-col-priority {
  width: 72px;
}
.wo-list-table .wo-list-col-id {
  width: 64px;
  max-width: 72px;
  padding-left: 6px;
  padding-right: 6px;
}
.wo-list-table th.wo-list-assignee-user-head {
  overflow: visible;
  padding: 6px 8px;
}
.wo-list-table .wo-list-header-select.wo-search-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.wo-list-table .wo-list-header-select .wo-ss-trigger {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  padding: 0.35rem 1.6rem 0.35rem 0.45rem;
  min-height: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  width: 100%;
}
.wo-list-table .wo-list-header-select.open .wo-ss-trigger,
.wo-list-table .wo-list-header-select.has-value .wo-ss-trigger,
.wo-list-table .wo-list-header-select .wo-ss-trigger:hover {
  border-color: #cbd5e1;
  background: #fff;
  color: #0f172a;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}
.wo-list-table .wo-list-header-select.has-value .wo-ss-trigger {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.wo-list-table .wo-list-col-amazon-wo {
  width: 136px;
}
.wo-list-table .wo-list-col-amazon-2d {
  width: 112px;
}
.wo-list-table .wo-list-col-id,
.wo-list-table .wo-list-col-amazon-wo,
.wo-list-table .wo-list-col-amazon-2d {
  overflow: visible;
}
.wo-list-table .wo-list-col-id .wo-list-id-link,
.wo-list-table .wo-list-col-amazon-wo .wo-list-cell-clip,
.wo-list-table .wo-list-col-amazon-2d .wo-list-cell-clip {
  display: inline-block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.wo-list-table .wo-list-col-title {
  width: 200px;
}
.wo-list-table .wo-list-col-date {
  width: 120px;
  min-width: 120px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  overflow: visible;
}
.wo-list-table th.wo-list-col-date {
  font-size: 11px;
  letter-spacing: 0.01em;
}
.wo-list-table .wo-list-col-location {
  width: 100px;
}
.wo-list-table .wo-list-col-tech {
  width: 148px;
}
.wo-list-table .wo-list-col-user {
  width: 168px;
}
.wo-list-table .wo-list-col-vendor {
  width: 170px;
}
.wo-list-table .wo-list-col-status {
  width: 168px;
}
.wo-list-status-cell,
.wo-list-assignee-user-cell {
  width: 168px;
  overflow: visible;
  position: relative;
  z-index: 0;
  background-clip: padding-box;
}
.wo-list-status-select.wo-search-select,
.wo-list-assignee-user-select.wo-search-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  isolation: isolate;
}
.wo-list-assignee-user-select .wo-ss-clear,
.wo-list-status-select .wo-ss-clear {
  z-index: 1;
}
.wo-list-assignee-user-select .wo-ss-trigger {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.4rem 1.75rem 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: none;
  background-color: #f8fafc;
  color: #0f172a;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-list-assignee-user-select .wo-ss-trigger::after {
  border-top-color: currentColor;
  opacity: 0.75;
}
.wo-list-assignee-user-select .wo-ss-dropdown,
.wo-list-assignee-user-select .wo-ss-dropdown-fixed {
  z-index: 1300;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  min-width: 100%;
  width: max-content;
  max-width: min(22rem, calc(100vw - 16px));
}
.wo-list-assignee-user-select .wo-ss-option {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
}
.wo-list-assignee-user-select.is-saving,
.wo-list-assignee-user-select.is-disabled {
  opacity: 0.7;
  pointer-events: none;
}
.wo-list-status-select .wo-ss-trigger {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.4rem 1.75rem 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: none;
  background-color: #f59e0b;
  color: #fff;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-list-table th.wo-list-actions-head,
.wo-list-table td.wo-list-actions-cell {
  /* View + Edit + Print + More (4 × 34px) with padding */
  width: 172px;
  min-width: 172px;
  max-width: 172px;
  text-align: center;
  padding-left: 10px;
  padding-right: 14px;
  position: sticky;
  right: 0;
  z-index: 4;
  overflow: visible;
  background: #fff;
  box-shadow: -8px 0 12px -10px rgba(15, 23, 42, 0.35);
}
.wo-list-table thead th.wo-list-actions-head {
  z-index: 7;
  background: #f9fafb;
  box-shadow:
    inset 0 -1px 0 #e5e7eb,
    -8px 0 12px -10px rgba(15, 23, 42, 0.35);
}
.wo-list-table tbody tr:hover td.wo-list-actions-cell {
  background: #f8fafc;
}
.wo-list-table td.wo-list-actions-cell .row-actions {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.wo-list-table .action-btn {
  border: 0 !important;
  background: transparent !important;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  box-shadow: none;
  filter: none;
}
.wo-list-table .action-btn.view,
.wo-list-table .action-btn.edit,
.wo-list-table .action-btn.communication,
.wo-list-table .action-btn.print,
.wo-list-table .action-btn.delete,
.wo-list-table .action-btn.more,
.wo-list-table .action-btn.document {
  border: 0 !important;
  background: transparent !important;
}
.wo-list-table .action-btn.view { color: #475569; }
.wo-list-table .action-btn.edit { color: #2563eb; }
.wo-list-table .action-btn.communication { color: #7c3aed; }
.wo-list-table .action-btn.print { color: #0f766e; }
.wo-list-table .action-btn.delete { color: #dc2626; }
.wo-list-table .action-btn.more { color: #475569; }
.wo-list-table .action-btn.document { color: #2563eb; }
.wo-list-table .action-btn:hover {
  filter: none;
  background: rgba(15, 23, 42, 0.06) !important;
}
.wo-list-table .action-btn.delete:hover {
  background: rgba(220, 38, 38, 0.1) !important;
}
.wo-list-table .action-btn.more:hover {
  background: rgba(15, 23, 42, 0.08) !important;
}
.wo-list-table td.wo-list-actions-cell .row-more-actions {
  position: relative;
  display: inline-flex;
}
.wo-list-table td.wo-list-actions-cell .document-actions-menu.document-actions-menu--icons {
  min-width: 0;
  width: max-content;
  padding: 4px;
}
.document-actions-menu--icons {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: max-content;
  padding: 4px;
}
.document-actions-menu--icons .document-actions-item.document-actions-item--icon {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 6px 10px;
  margin: 0;
  line-height: 1;
  text-align: left;
}
.document-actions-menu--icons .document-actions-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  line-height: 0;
}
.document-actions-menu--icons .document-actions-item-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.document-actions-menu--icons .document-actions-item-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.document-actions-menu--icons .document-actions-item--icon:not(.is-danger) {
  color: #2563eb;
}
.wo-list-vendor-hover,
.wo-list-location-hover,
.wo-list-tech-hover {
  cursor: help;
}
.wo-list-hover-card {
  position: fixed;
  z-index: 1500;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  pointer-events: none;
  width: max-content;
}
.wo-list-hover-card.cm-list-hover-card {
  z-index: 20000;
  min-width: 180px;
  border-color: #cbd5e1;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}
.wo-list-hover-card.is-status {
  min-width: 0;
  max-width: none;
  padding: 3px;
  border-radius: 999px;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}
.wo-list-hover-card.is-vendor,
.wo-list-hover-card.is-location,
.wo-list-hover-card.is-tech,
.wo-list-hover-card.is-title {
  min-width: 220px;
}
.wo-list-hover-card.is-title {
  max-width: min(420px, calc(100vw - 24px));
}
.wo-list-hover-card-title-only .wo-list-hover-card-kicker {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.wo-list-hover-card-title-only .wo-list-hover-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}
.wo-list-hover-card-person + .wo-list-hover-card-person {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}
.wo-list-hover-card-person-name {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.wo-list-hover-card-empty {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}
.wo-list-hover-card.hidden {
  display: none;
}
.wo-list-hover-card-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.wo-list-hover-card-meta {
  margin: 0;
  display: grid;
  gap: 6px;
}
.wo-list-hover-card-meta div {
  display: grid;
  gap: 2px;
}
.wo-list-hover-card-meta dt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.wo-list-hover-card-meta dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
  word-break: break-word;
}
.wo-list-hover-card-status {
  padding: 0;
  display: inline-flex;
  line-height: 0;
}
.wo-list-status-full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background-color: #64748b;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.wo-list-title-cell {
  max-width: 100%;
  font-weight: 700;
  color: #0f172a;
}
.wo-list-id-link {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.wo-list-id-link:hover {
  text-decoration: underline;
}
.wo-priority-chip,
.wo-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.wo-priority-chip.tone-critical {
  background: #fee2e2;
  color: #b91c1c;
}
.wo-priority-chip.tone-medium {
  background: #fef9c3;
  color: #a16207;
}
.wo-priority-chip.tone-low {
  background: #dbeafe;
  color: #1d4ed8;
}
.wo-status-chip.status-return-trip-needed { background: #fef3c7; color: #b45309; }
.wo-status-chip.status-parts-needed { background: #ffe4e6; color: #be123c; }

/* Unique soft status tones — reactive + preventive (one hue per status) */
.wo-status-chip.status-pending { background: #fffbeb; color: #b45309; }
.wo-status-chip.status-open { background: #fff7ed; color: #c2410c; }
.wo-status-chip.status-need-vendor { background: #ffedd5; color: #9a3412; }
.wo-status-chip.status-scheduling-with-vendor,
.wo-status-chip.status-assigned-to-vendor { background: #e0f2fe; color: #0369a1; }
.wo-status-chip.status-proposal-needed,
.wo-status-chip.status-need-proposal { background: #f3e8ff; color: #6d28d9; }
.wo-status-chip.status-need-proposal-for-repairs { background: #ede9fe; color: #5b21b6; }
.wo-status-chip.status-proposal-sent { background: #fdf4ff; color: #a21caf; }
.wo-status-chip.status-waiting-for-approval { background: #fef9c3; color: #a16207; }
.wo-status-chip.status-proposal-not-approved { background: #fee2e2; color: #b91c1c; }
.wo-status-chip.status-proposal-approved { background: #ccfbf1; color: #0f766e; }
.wo-status-chip.status-approved-needs-scheduling,
.wo-status-chip.status-approved-need-to-scheduled,
.wo-status-chip.status-need-to-schedule { background: #d1fae5; color: #047857; }
.wo-status-chip.status-need-to-reschedule { background: #cffafe; color: #0e7490; }
.wo-status-chip.status-rescheduled { background: #e0e7ff; color: #3730a3; }
.wo-status-chip.status-hold { background: #f5f5f4; color: #57534e; }
.wo-status-chip.status-job-is-done-waiting-for-report { background: #ccfbf1; color: #0f766e; }
.wo-status-chip.status-approved-waiting-for-parts { background: #ffe4e6; color: #be123c; }
.wo-status-chip.status-completed-invoice-needed,
.wo-status-chip.status-work-completed-need-to-invoice { background: #fef3c7; color: #854d0e; }
.wo-status-chip.status-completed-need-invoice { background: #fef9c3; color: #a16207; }
.wo-status-chip.status-completed-bill-for-incurred-costs { background: #ffedd5; color: #92400e; }
.wo-status-chip.status-completed-vendor-payment-needed { background: #fce7f3; color: #9d174d; }
.wo-status-chip.status-completed-vendor-paid,
.wo-status-chip.status-invoiced { background: #ecfccb; color: #3f6212; }
.wo-status-chip.status-completed-need-to-send-uplift { background: #ffedd5; color: #9a3412; }
.wo-status-chip.status-uplift-send { background: #ccfbf1; color: #0f766e; }
.wo-status-chip.status-billed { background: #d9f99d; color: #3f6212; }
.wo-status-chip.status-completed,
.wo-status-chip.status-complete { background: #bbf7d0; color: #166534; }
.wo-status-chip.status-canceled,
.wo-status-chip.status-cancelled { background: #e2e8f0; color: #475569; }
.wo-status-chip.status-scheduled,
.wo-status-chip.status-active { background: #dbeafe; color: #1d4ed8; }
.wo-status-chip.status-processing,
.wo-status-chip.status-in-progress { background: #ede9fe; color: #5b21b6; }

.wo-list-status-full.status-pending { background-color: #f59e0b; }
.wo-list-status-full.status-open { background-color: #f97316; }
.wo-list-status-full.status-need-vendor { background-color: #ea580c; }
.wo-list-status-full.status-scheduling-with-vendor,
.wo-list-status-full.status-assigned-to-vendor { background-color: #0284c7; }
.wo-list-status-full.status-proposal-needed,
.wo-list-status-full.status-need-proposal { background-color: #7c3aed; }
.wo-list-status-full.status-need-proposal-for-repairs { background-color: #6d28d9; }
.wo-list-status-full.status-proposal-sent { background-color: #c026d3; }
.wo-list-status-full.status-waiting-for-approval { background-color: #ca8a04; }
.wo-list-status-full.status-proposal-not-approved { background-color: #dc2626; }
.wo-list-status-full.status-proposal-approved { background-color: #0d9488; }
.wo-list-status-full.status-approved-needs-scheduling,
.wo-list-status-full.status-approved-need-to-scheduled,
.wo-list-status-full.status-need-to-schedule { background-color: #059669; }
.wo-list-status-full.status-need-to-reschedule { background-color: #0891b2; }
.wo-list-status-full.status-rescheduled { background-color: #4f46e5; }
.wo-list-status-full.status-hold { background-color: #78716c; }
.wo-list-status-full.status-job-is-done-waiting-for-report { background-color: #14b8a6; }
.wo-list-status-full.status-approved-waiting-for-parts { background-color: #e11d48; }
.wo-list-status-full.status-completed-invoice-needed,
.wo-list-status-full.status-work-completed-need-to-invoice { background-color: #a16207; }
.wo-list-status-full.status-completed-need-invoice { background-color: #d97706; }
.wo-list-status-full.status-completed-bill-for-incurred-costs { background-color: #b45309; }
.wo-list-status-full.status-completed-vendor-payment-needed { background-color: #be185d; }
.wo-list-status-full.status-completed-vendor-paid,
.wo-list-status-full.status-invoiced { background-color: #65a30d; }
.wo-list-status-full.status-completed-need-to-send-uplift { background-color: #c2410c; }
.wo-list-status-full.status-uplift-send { background-color: #0f766e; }
.wo-list-status-full.status-billed { background-color: #4d7c0f; }
.wo-list-status-full.status-completed,
.wo-list-status-full.status-complete { background-color: #15803d; }
.wo-list-status-full.status-canceled,
.wo-list-status-full.status-cancelled { background-color: #64748b; }
.wo-list-status-full.status-scheduled,
.wo-list-status-full.status-active { background-color: #2563eb; }
.wo-list-status-full.status-processing,
.wo-list-status-full.status-in-progress { background-color: #9333ea; }

/* Shared solid status colors — list chips, list/view/drawer triggers all match */
.wo-drawer-status-select.wo-search-select { width: 100%; }
.wo-drawer-status-select .wo-ss-trigger {
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
}

/* Status dropdown options: one simple hover (no per-status recolor) */
.wo-drawer-status-select .wo-ss-option,
.wo-list-status-select .wo-ss-option {
  color: #334155;
  background: transparent;
}
.wo-drawer-status-select .wo-ss-option:hover,
.wo-drawer-status-select .wo-ss-option.highlight,
.wo-drawer-status-select .wo-ss-option.is-selected,
.wo-list-status-select .wo-ss-option:hover,
.wo-list-status-select .wo-ss-option.highlight,
.wo-list-status-select .wo-ss-option.is-selected {
  background-color: #f1f5f9;
  color: #0f172a;
}

.wo-list-status-select .wo-ss-trigger::after {
  border-top-color: currentColor;
  opacity: 0.9;
}
.wo-list-status-select .wo-ss-dropdown,
.wo-list-status-select .wo-ss-dropdown-fixed,
.wo-ss-dropdown.wo-ss-dropdown-portal {
  z-index: 1300;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  min-width: 100%;
  width: max-content;
  max-width: min(22rem, calc(100vw - 16px));
}
.wo-list-status-select .wo-ss-option {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
}
.wo-list-status-select.is-saving,
.wo-list-status-select.is-disabled {
  opacity: 0.7;
  pointer-events: none;
}

/* Cost Management list — horizontal scroll + sticky header/actions */
.wo-proposal-page .table-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.wo-proposal-page .table-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.wo-proposal-list-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}
.wo-proposal-list-table th,
.wo-proposal-list-table td {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  vertical-align: middle;
}
.wo-proposal-list-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f9fafb;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #e5e7eb;
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wo-proposal-list-table td {
  padding: 12px 14px;
  background: #fff;
  background-clip: padding-box;
}
.wo-proposal-list-table tbody tr:hover td {
  background: #f8fafc;
}
/* Column widths: readable headers/values without Vendor/Payment Source stretching. */
.wo-proposal-list-table th:nth-child(1),
.wo-proposal-list-table td:nth-child(1) { min-width: 220px; } /* Title */
.wo-proposal-list-table th:nth-child(2),
.wo-proposal-list-table td:nth-child(2) { min-width: 120px; } /* Work Order # */
.wo-proposal-list-table th:nth-child(3),
.wo-proposal-list-table td:nth-child(3) { min-width: 120px; } /* Vendor Rate */
.wo-proposal-list-table th:nth-child(4),
.wo-proposal-list-table td:nth-child(4) { min-width: 150px; } /* A.Proposal Amount */
.wo-proposal-list-table th:nth-child(5),
.wo-proposal-list-table td:nth-child(5) {
  width: 148px;
  min-width: 148px;
  max-width: 148px;
  overflow: hidden;
} /* Vendor — fixed; full name on hover card */
.wo-proposal-list-table th:nth-child(6),
.wo-proposal-list-table td:nth-child(6) {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  overflow: hidden;
} /* Vendor Payment Status */
.wo-proposal-list-table th:nth-child(6) {
  white-space: normal;
  line-height: 1.25;
} /* keep header readable without widening the column */
.wo-proposal-list-table th:nth-child(7),
.wo-proposal-list-table td:nth-child(7) {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  overflow: hidden;
} /* Payment Source — fixed so Account Transfer does not stretch */
.wo-proposal-list-table th:nth-child(7) {
  white-space: normal;
  line-height: 1.25;
}
.wo-proposal-list-table th:nth-child(8),
.wo-proposal-list-table td:nth-child(8) { min-width: 110px; } /* Amazon */
.wo-proposal-list-table th:nth-child(9),
.wo-proposal-list-table td:nth-child(9) { min-width: 130px; } /* 2D Num */
.wo-proposal-list-table th:nth-child(10),
.wo-proposal-list-table td:nth-child(10) { min-width: 110px; } /* Created */
.wo-proposal-list-table .wo-proposal-list-col-vendor {
  overflow: hidden;
  cursor: help;
}
.wo-proposal-list-table .wo-proposal-list-col-vendor .wo-list-cell-clip {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}
.wo-proposal-list-table th.col-actions,
.wo-proposal-list-table td.col-actions {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  position: sticky;
  right: 0;
  z-index: 6;
  overflow: visible;
  background: #fff;
  box-shadow: -8px 0 12px -10px rgba(15, 23, 42, 0.35);
}
.wo-proposal-list-table thead th.col-actions {
  z-index: 8;
  background: #f9fafb;
  box-shadow:
    inset 0 -1px 0 #e5e7eb,
    -8px 0 12px -10px rgba(15, 23, 42, 0.35);
}
.wo-proposal-list-table tbody tr:hover td.col-actions {
  background: #f8fafc;
}
.wo-proposal-list-table td.col-actions .row-actions {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin: 0;
}
.wo-proposal-list-table td.col-actions .action-btn {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Cost Management list — payment status / source inline selects */
.wo-cm-payment-status-cell,
.wo-cm-payment-source-cell {
  overflow: hidden;
  position: relative;
  z-index: 0;
}
.wo-cm-payment-status-select.wo-search-select,
.wo-cm-payment-source-select.wo-search-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.wo-cm-payment-status-select .wo-ss-trigger,
.wo-cm-payment-source-select .wo-ss-trigger {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.4rem 1.75rem 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-cm-payment-status-select.status-paid .wo-ss-trigger {
  background-color: #059669;
  color: #fff;
  border-color: #059669;
}
.wo-cm-payment-status-select.status-unpaid .wo-ss-trigger {
  background-color: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.wo-cm-payment-source-select .wo-ss-trigger {
  background-color: #f8fafc;
  color: #0f172a;
}
.wo-cm-payment-source-select.has-clear .wo-ss-trigger {
  padding-right: 2.35rem;
}
.wo-cm-payment-status-select .wo-ss-trigger,
.wo-cm-payment-source-select .wo-ss-trigger {
  cursor: help;
}
.wo-cm-hover-chip.status-paid {
  background-color: #059669;
  color: #fff;
}
.wo-cm-hover-chip.status-unpaid {
  background-color: #dc2626;
  color: #fff;
}
.wo-cm-hover-chip.status-source {
  background-color: #0f172a;
  color: #fff;
}
.wo-cm-payment-status-select.is-saving,
.wo-cm-payment-status-select.is-disabled,
.wo-cm-payment-source-select.is-saving,
.wo-cm-payment-source-select.is-disabled {
  opacity: 0.7;
  pointer-events: none;
}

/* List + drawer triggers — same unique palette as .wo-list-status-full */
.wo-list-status-select.status-pending .wo-ss-trigger,
.wo-drawer-status-select.status-pending .wo-ss-trigger { background-color: #f59e0b; color: #fff; border-color: #f59e0b; }
.wo-list-status-select.status-open .wo-ss-trigger,
.wo-drawer-status-select.status-open .wo-ss-trigger { background-color: #f97316; color: #fff; border-color: #f97316; }
.wo-list-status-select.status-need-vendor .wo-ss-trigger,
.wo-drawer-status-select.status-need-vendor .wo-ss-trigger { background-color: #ea580c; color: #fff; border-color: #ea580c; }
.wo-list-status-select.status-scheduling-with-vendor .wo-ss-trigger,
.wo-list-status-select.status-assigned-to-vendor .wo-ss-trigger,
.wo-drawer-status-select.status-scheduling-with-vendor .wo-ss-trigger,
.wo-drawer-status-select.status-assigned-to-vendor .wo-ss-trigger { background-color: #0284c7; color: #fff; border-color: #0284c7; }
.wo-list-status-select.status-proposal-needed .wo-ss-trigger,
.wo-list-status-select.status-need-proposal .wo-ss-trigger,
.wo-drawer-status-select.status-proposal-needed .wo-ss-trigger,
.wo-drawer-status-select.status-need-proposal .wo-ss-trigger { background-color: #7c3aed; color: #fff; border-color: #7c3aed; }
.wo-list-status-select.status-need-proposal-for-repairs .wo-ss-trigger,
.wo-drawer-status-select.status-need-proposal-for-repairs .wo-ss-trigger { background-color: #6d28d9; color: #fff; border-color: #6d28d9; }
.wo-list-status-select.status-proposal-sent .wo-ss-trigger,
.wo-drawer-status-select.status-proposal-sent .wo-ss-trigger { background-color: #c026d3; color: #fff; border-color: #c026d3; }
.wo-list-status-select.status-waiting-for-approval .wo-ss-trigger,
.wo-drawer-status-select.status-waiting-for-approval .wo-ss-trigger { background-color: #ca8a04; color: #fff; border-color: #ca8a04; }
.wo-list-status-select.status-proposal-not-approved .wo-ss-trigger,
.wo-drawer-status-select.status-proposal-not-approved .wo-ss-trigger { background-color: #dc2626; color: #fff; border-color: #dc2626; }
.wo-list-status-select.status-proposal-approved .wo-ss-trigger,
.wo-drawer-status-select.status-proposal-approved .wo-ss-trigger { background-color: #0d9488; color: #fff; border-color: #0d9488; }
.wo-list-status-select.status-approved-needs-scheduling .wo-ss-trigger,
.wo-list-status-select.status-approved-need-to-scheduled .wo-ss-trigger,
.wo-list-status-select.status-need-to-schedule .wo-ss-trigger,
.wo-drawer-status-select.status-approved-needs-scheduling .wo-ss-trigger,
.wo-drawer-status-select.status-approved-need-to-scheduled .wo-ss-trigger,
.wo-drawer-status-select.status-need-to-schedule .wo-ss-trigger { background-color: #059669; color: #fff; border-color: #059669; }
.wo-list-status-select.status-need-to-reschedule .wo-ss-trigger,
.wo-drawer-status-select.status-need-to-reschedule .wo-ss-trigger { background-color: #0891b2; color: #fff; border-color: #0891b2; }
.wo-list-status-select.status-rescheduled .wo-ss-trigger,
.wo-drawer-status-select.status-rescheduled .wo-ss-trigger { background-color: #4f46e5; color: #fff; border-color: #4f46e5; }
.wo-list-status-select.status-hold .wo-ss-trigger,
.wo-drawer-status-select.status-hold .wo-ss-trigger { background-color: #78716c; color: #fff; border-color: #78716c; }
.wo-list-status-select.status-job-is-done-waiting-for-report .wo-ss-trigger,
.wo-drawer-status-select.status-job-is-done-waiting-for-report .wo-ss-trigger { background-color: #14b8a6; color: #fff; border-color: #14b8a6; }
.wo-list-status-select.status-approved-waiting-for-parts .wo-ss-trigger,
.wo-drawer-status-select.status-approved-waiting-for-parts .wo-ss-trigger { background-color: #e11d48; color: #fff; border-color: #e11d48; }
.wo-list-status-select.status-completed-invoice-needed .wo-ss-trigger,
.wo-list-status-select.status-work-completed-need-to-invoice .wo-ss-trigger,
.wo-drawer-status-select.status-completed-invoice-needed .wo-ss-trigger,
.wo-drawer-status-select.status-work-completed-need-to-invoice .wo-ss-trigger { background-color: #a16207; color: #fff; border-color: #a16207; }
.wo-list-status-select.status-completed-need-invoice .wo-ss-trigger,
.wo-drawer-status-select.status-completed-need-invoice .wo-ss-trigger { background-color: #d97706; color: #fff; border-color: #d97706; }
.wo-list-status-select.status-completed-bill-for-incurred-costs .wo-ss-trigger,
.wo-drawer-status-select.status-completed-bill-for-incurred-costs .wo-ss-trigger { background-color: #b45309; color: #fff; border-color: #b45309; }
.wo-list-status-select.status-completed-vendor-payment-needed .wo-ss-trigger,
.wo-drawer-status-select.status-completed-vendor-payment-needed .wo-ss-trigger { background-color: #be185d; color: #fff; border-color: #be185d; }
.wo-list-status-select.status-completed-vendor-paid .wo-ss-trigger,
.wo-list-status-select.status-invoiced .wo-ss-trigger,
.wo-drawer-status-select.status-completed-vendor-paid .wo-ss-trigger,
.wo-drawer-status-select.status-invoiced .wo-ss-trigger { background-color: #65a30d; color: #fff; border-color: #65a30d; }
.wo-list-status-select.status-completed-need-to-send-uplift .wo-ss-trigger,
.wo-drawer-status-select.status-completed-need-to-send-uplift .wo-ss-trigger { background-color: #c2410c; color: #fff; border-color: #c2410c; }
.wo-list-status-select.status-uplift-send .wo-ss-trigger,
.wo-drawer-status-select.status-uplift-send .wo-ss-trigger { background-color: #0f766e; color: #fff; border-color: #0f766e; }
.wo-list-status-select.status-billed .wo-ss-trigger,
.wo-drawer-status-select.status-billed .wo-ss-trigger { background-color: #4d7c0f; color: #fff; border-color: #4d7c0f; }
.wo-list-status-select.status-completed .wo-ss-trigger,
.wo-list-status-select.status-complete .wo-ss-trigger,
.wo-drawer-status-select.status-completed .wo-ss-trigger,
.wo-drawer-status-select.status-complete .wo-ss-trigger { background-color: #15803d; color: #fff; border-color: #15803d; }
.wo-list-status-select.status-canceled .wo-ss-trigger,
.wo-list-status-select.status-cancelled .wo-ss-trigger,
.wo-drawer-status-select.status-canceled .wo-ss-trigger,
.wo-drawer-status-select.status-cancelled .wo-ss-trigger { background-color: #64748b; color: #fff; border-color: #64748b; }
.wo-list-status-select.status-scheduled .wo-ss-trigger,
.wo-list-status-select.status-active .wo-ss-trigger,
.wo-drawer-status-select.status-scheduled .wo-ss-trigger,
.wo-drawer-status-select.status-active .wo-ss-trigger { background-color: #2563eb; color: #fff; border-color: #2563eb; }
.wo-list-status-select.status-processing .wo-ss-trigger,
.wo-list-status-select.status-in-progress .wo-ss-trigger,
.wo-drawer-status-select.status-processing .wo-ss-trigger,
.wo-drawer-status-select.status-in-progress .wo-ss-trigger { background-color: #9333ea; color: #fff; border-color: #9333ea; }

.wo-list-pagination {
  padding: 14px 16px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: #fff;
}
.wo-list-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}
.wo-list-page-btn {
  min-height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.wo-list-page-btn:hover:not(:disabled) {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.wo-list-page-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.wo-list-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.wo-list-page-ellipsis {
  color: #94a3b8;
  font-weight: 700;
  padding: 0 4px;
}
@media (max-width: 1100px) {
  .wo-list-hero-actions {
    width: 100%;
  }
  .wo-list-hero-search {
    flex: 1;
    min-width: 0;
  }
}
@media (max-width: 720px) {
  .wo-list-filters-grid {
    grid-template-columns: 1fr;
  }
  .wo-list-filter-popover {
    right: auto;
    left: 0;
  }
  .wo-list-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .wo-list-page-nav {
    justify-content: flex-start;
  }
}

.employee-cell { display: inline-flex; align-items: center; gap: 10px; justify-content: center; }
.avatar-dot {
  width: 36px; height: 36px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.type-badge {
  display: inline-block;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.row-actions { display: inline-flex; gap: 6px; justify-content: center; }
.action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e5e7eb; background: #fff; border-radius: 10px;
  width: 36px; height: 36px; padding: 0; cursor: pointer;
}
.action-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.action-btn.view { color: #374151; }
.action-btn.edit { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.action-btn.email { color: #0369a1; border-color: #bae6fd; background: #f0f9ff; }
.action-btn.communication { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
.action-btn.print { color: #0f766e; border-color: #99f6e4; background: #f0fdfa; }
.action-btn.delete { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.action-btn.document { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.action-btn:hover { filter: brightness(0.97); }
.document-actions,
.document-actions-footer {
  position: relative;
  display: inline-flex;
}
.document-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  padding: 6px;
  z-index: 120;
}
.document-actions-menu.is-floating {
  position: fixed;
  right: auto;
  top: auto;
  margin: 0;
  z-index: 1300;
}
.document-actions-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}
.document-actions-item:hover {
  background: #f1f5f9;
}
.document-actions-item.is-danger {
  color: #b91c1c;
}
.document-actions-item.is-danger:hover {
  background: #fef2f2;
}
.document-actions-menu.document-actions-menu--icons {
  min-width: 0;
  width: max-content;
}
.document-actions-menu--icons .document-actions-item.document-actions-item--icon {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  width: auto;
}
.document-actions-footer-trigger::after {
  content: "";
}
.document-email-dialog {
  z-index: 1320;
}
#documentEmailOverlay {
  z-index: 1310;
}
.document-email-dialog #documentEmailMessage {
  min-height: 160px;
  resize: vertical;
}
.document-email-attachment-note {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.modal-lg { width: min(760px, calc(100vw - 24px)); max-height: 88vh; }
.modal-md { width: min(620px, calc(100vw - 24px)); max-height: 88vh; }
.modal-xl { width: min(980px, calc(100vw - 24px)); max-height: 88vh; }
.vendor-invite-dialog {
  z-index: 1320;
  width: min(780px, calc(100vw - 24px));
  max-height: 92vh;
}
#vendorInviteOverlay {
  z-index: 1310;
}
.vendor-invite-dialog .vendor-invite-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}
.vendor-invite-preview {
  display: block;
  width: 100%;
  min-height: 380px;
  height: min(48vh, 520px);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #eef2f7;
}
.vendor-invite-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #64748b;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
  margin-top: auto;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  flex-shrink: 0;
}
.entity-form {
  gap: 0;
}
.modal-form.entity-form > .entity-section,
.modal-form.entity-form > .access-tip,
.modal-form.entity-form > input[type="hidden"] + .entity-section,
.modal-form-body > .entity-section,
.modal-form-body > input[type="hidden"] + .entity-section {
  margin-left: 20px;
  margin-right: 20px;
}
.modal-form.entity-form > .entity-section:first-of-type,
.modal-form.entity-form > input[type="hidden"] + .entity-section,
.modal-form-body > .entity-section:first-of-type,
.modal-form-body > input[type="hidden"] + .entity-section {
  margin-top: 20px;
}
.modal-form.entity-form > .entity-section + .entity-section,
.modal-form-body > .entity-section + .entity-section {
  margin-top: 14px;
}
.modal-form.entity-form > .entity-field,
.modal-form-body > .entity-field {
  margin-left: 20px;
  margin-right: 20px;
}
.modal-form.entity-form > .entity-field:first-of-type,
.modal-form-body > .entity-field:first-of-type {
  margin-top: 20px;
}
.modal-form.entity-form > .entity-field + .entity-field,
.modal-form-body > .entity-field + .entity-field {
  margin-top: 14px;
}
.modal-form.entity-form > .entity-section:last-child,
.modal-form-body > .entity-section:last-child,
.modal-form.entity-form > .entity-field:last-child,
.modal-form-body > .entity-field:last-child {
  margin-bottom: 12px;
}
.modal-form.entity-form > .access-tip,
.modal-form-body > .access-tip {
  margin-left: 20px;
  margin-right: 20px;
  margin-top: 14px;
  margin-bottom: 4px;
}
.modal-form.entity-form > .modal-footer {
  margin-top: 18px;
}
.modal-form.entity-form.part-view-body,
.modal-form.entity-form.part-view-body > .entity-section {
  margin-top: 0;
}
.modal-form.entity-form.part-view-body {
  padding: 20px;
  gap: 14px;
  display: grid;
}
.entity-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.entity-section-title {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
}
.entity-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
#woProposalSeriesSiteRow.is-series-only {
  grid-template-columns: minmax(0, 1fr);
}
.entity-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.manager-poc-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.manager-poc-card {
  margin: 0;
}
.data-table th.manager-poc-actions-col,
.data-table td.manager-poc-actions-col {
  width: 1%;
  white-space: nowrap;
  padding-right: 20px;
}
.data-table th.manager-poc-actions-col {
  text-align: center;
}
.data-table td.manager-poc-actions-col {
  text-align: right;
}
.data-table td.manager-poc-actions-col .row-actions {
  justify-content: flex-end;
}
.manager-poc-email-hint {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.manager-poc-email-select-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.manager-poc-email-list {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding-right: 2px;
}
.manager-poc-email-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.manager-poc-email-option:hover {
  border-color: #bae6fd;
  background: #f8fbff;
}
.manager-poc-email-option input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: #0284c7;
  flex: 0 0 auto;
}
.manager-poc-email-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.manager-poc-email-option-copy strong {
  font-size: 14px;
  color: #0f172a;
}
.manager-poc-email-option-copy span {
  font-size: 13px;
  color: #475569;
  word-break: break-word;
}
.manager-poc-email-option-phone {
  color: #64748b !important;
  font-size: 12px !important;
}
.manager-poc-email-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
}
.manager-poc-site-name {
  font-weight: 700;
  color: #0f172a;
}
.manager-poc-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 800;
}
.manager-poc-primary-cell {
  color: #334155;
  font-size: 14px;
}
.manager-poc-more-note {
  margin-left: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}
.manager-poc-view-site {
  display: flex;
  align-items: center;
  gap: 10px;
}
.manager-poc-view-site strong {
  font-size: 16px;
  color: #0f172a;
}
.manager-poc-view-table-wrap {
  max-height: 360px;
}
.manager-poc-view-table td:first-child,
.manager-poc-view-table th:first-child {
  width: 48px;
  text-align: center;
}
.manager-poc-remove-row {
  color: #b91c1c;
}
.entity-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.entity-section-head .entity-section-title {
  padding-bottom: 0;
  border-bottom: 0;
}
.entity-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.entity-field-span-2 {
  grid-column: 1 / -1;
}
.entity-inline-actions {
  display: flex;
  justify-content: flex-start;
}
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #334155;
  margin: 0;
}
.field-hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}
.field-select-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.field-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #64748b;
  pointer-events: none;
  z-index: 1;
}
.entity-form .entity-field input:not([type="hidden"]):not([type="checkbox"]):not([type="file"]):not([type="radio"]),
.entity-form .entity-field textarea,
.entity-form .entity-field select,
.entity-form .entity-field .field-select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 11px 14px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.entity-form .entity-field textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.5;
  padding-top: 12px;
}
.entity-form .entity-field select,
.entity-form .entity-field .field-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  cursor: pointer;
  background-color: #fff;
  display: block;
}
.entity-form .field-select-wrap select,
.entity-form .field-select-wrap .field-select {
  width: 100%;
  padding-right: 42px;
}
.entity-form.is-readonly input:not([type="hidden"]),
.entity-form.is-readonly textarea,
.entity-form.is-readonly select,
.entity-form.is-readonly .field-select,
.entity-form.is-readonly .wo-search-select .wo-ss-trigger,
.entity-form.is-readonly .wo-ss-root .wo-ss-trigger {
  background-color: #f8fafc;
  color: #475569;
  cursor: default;
}
.entity-form.is-readonly .wo-search-select.is-disabled,
.entity-form.is-readonly .wo-ss-root.is-disabled {
  pointer-events: none;
  opacity: 0.92;
}
.entity-form.is-readonly .wo-ss-clear {
  display: none;
}
.entity-form.is-readonly .category-icon-grid,
.entity-form.is-readonly .category-upload-link {
  pointer-events: none;
  opacity: 0.75;
}
.modal-card > .part-view-body,
.modal-card > .modal-form.part-view-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.entity-form .entity-field input::placeholder,
.entity-form .entity-field textarea::placeholder {
  color: #94a3b8;
  font-weight: 500;
}
.entity-form .entity-field input:hover:not(:disabled),
.entity-form .entity-field textarea:hover:not(:disabled),
.entity-form .entity-field select:hover:not(:disabled) {
  border-color: #cbd5e1;
}
.entity-form .entity-field input:focus,
.entity-form .entity-field textarea:focus,
.entity-form .entity-field select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}
.entity-form .entity-field .wo-search-select .wo-ss-trigger,
.entity-form .entity-field .wo-ss-root .wo-ss-trigger {
  min-height: 46px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 11px 40px 11px 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.entity-form .entity-field .wo-search-select .wo-ss-trigger:focus,
.entity-form .entity-field .wo-ss-root .wo-ss-trigger:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.entity-form .contact-row input {
  min-height: 42px;
  border-radius: 10px;
}
.part-view-body .entity-section {
  margin: 0;
}
.part-view-field {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.part-view-field dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 5px;
  font-weight: 800;
}
.part-view-field dd {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
  word-break: break-word;
}
.part-view-body .entity-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.color-swatch {
  width: 36px; height: 36px; border-radius: 999px; border: 2px solid transparent; cursor: pointer;
}
.color-swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #64748b; transform: scale(1.05); }
.contact-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.contact-row input { min-width: 0; }

.alert { border-radius: 16px; padding: 12px 14px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.table-loader {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,0.85); z-index: 2; font-weight: 700; color: var(--primary);
}
.page-orbit-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(5px);
  border-radius: inherit;
}
.page-orbit-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.page-orbit-loader-inner p {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
}
.access-list-panel { position: relative; overflow: hidden; }
.tracking-layout { position: relative; }
.tracking-layout.is-loading > section { opacity: .55; pointer-events: none; transition: opacity .25s ease; }

.sidebar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sidebar-close-btn {
  margin-left: auto;
}
.sidebar-open-btn {
  position: fixed; top: 16px; left: 16px; z-index: 60;
  box-shadow: 0 4px 14px rgba(15,23,42,.12);
  display: none;
}
.sidebar-open-btn:not(.hidden) {
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 40;
}
.nav-icon { opacity: .65; margin-right: 4px; }
.users-chevron { margin-left: auto; transition: transform .2s; }
.users-chevron.open { transform: rotate(90deg); }

.profile-modal-overlay {
  background: rgba(15, 23, 42, .48); z-index: 85;
}
.profile-modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; pointer-events: none;
}
.profile-modal:not(.hidden) { pointer-events: auto; }
.profile-modal-card {
  position: relative;
  width: min(560px, 100%); background: #fff; border-radius: 24px;
  overflow: hidden; border: 1px solid #f3f4f6;
  box-shadow: 0 25px 50px rgba(15,23,42,.2);
  animation: profileModalIn .18s ease-out;
  pointer-events: auto;
  max-height: calc(100vh - 32px);
  transition: width .22s ease, min-height .22s ease, max-height .22s ease, height .22s ease;
}
.profile-modal-card.is-incard-open {
  width: min(720px, calc(100vw - 32px));
  min-height: min(680px, calc(100vh - 48px));
  max-height: calc(100vh - 32px);
}
@keyframes profileModalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes profileRequestsIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.profile-modal-header {
  position: relative; height: 128px;
  background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
}
.jha-editor-close {
  margin: -4px -4px 0 0;
}
.modal-header .modal-close-btn {
  margin: -2px -2px -2px 0;
}
.profile-modal-close {
  position: absolute; top: 16px; right: 16px;
}
.profile-modal-avatar {
  position: absolute; left: 32px; bottom: -48px;
  width: 96px; height: 96px; border-radius: 24px;
  background: #2563eb; border: 4px solid #fff;
  box-shadow: 0 12px 32px rgba(15,23,42,.15);
  display: grid; place-items: center; overflow: hidden;
}
#profileModalInitial {
  font-size: 32px; font-weight: 800; color: #fff; line-height: 1;
}
.profile-modal-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-modal-body { padding: 64px 32px 32px; }
.profile-modal-intro { margin-bottom: 24px; }
.profile-modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.profile-modal-body h3 {
  margin: 0; font-size: 24px; font-weight: 800; color: #111827; letter-spacing: -0.02em;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-modal-shortcuts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.profile-shortcut-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #dbe4f0;
  background: #f8fafc;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}
.profile-shortcut-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.profile-shortcut-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.profile-requests-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  bottom: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15,23,42,.18);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 6;
}
.profile-requests-panel:not(.hidden) {
  animation: profileRequestsIn .22s ease-out;
}
.profile-incard-panel {
  z-index: 6;
}
.profile-requests-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
  background: #fff;
}
.profile-requests-panel-head h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}
.profile-requests-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #f8fafc;
  border-radius: 999px;
  color: #64748b;
  cursor: pointer;
}
.profile-requests-close svg {
  width: 16px;
  height: 16px;
}
.profile-requests-list {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.settings-home {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1180px;
  padding: 0 12px;
  box-sizing: border-box;
}
.settings-nav-btn {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.settings-nav-btn:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  color: #0f172a;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}
.settings-nav-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
}
.settings-nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-nav-icon--danger {
  background: #fef2f2;
  color: #dc2626;
}
.settings-nav-icon--primary {
  background: #eff6ff;
  color: #2563eb;
}
.settings-nav-icon--teal {
  background: #f0fdfa;
  color: #0d9488;
}
.settings-nav-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.settings-nav-copy strong {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.settings-nav-copy small {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}
@media (max-width: 900px) {
  .settings-home {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}
.settings-user-activity-view,
.settings-user-activity-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 16px;
  width: 100%;
  max-width: none;
  margin: 0;
}
.settings-user-activity-view.hidden {
  display: none;
}
.settings-deleted-wo-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 16px;
  width: 100%;
}
.settings-deleted-wo-page .settings-deleted-wo-search {
  width: min(340px, 42vw);
  max-width: 340px;
  margin-left: 0;
}
.settings-user-activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: end;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  padding: 4px 0 2px;
}
.settings-filter-field {
  display: grid;
  gap: 6px;
  min-width: 150px;
  flex: 0 1 170px;
}
.settings-filter-field-user {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 340px;
}
.settings-filter-field span {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.settings-filter-field select,
.settings-filter-field input {
  min-height: 44px;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  box-sizing: border-box;
}
.settings-filter-field .wo-search-select {
  width: 100%;
}
.settings-filter-field .wo-search-select .wo-ss-trigger {
  min-height: 44px;
  padding: 10px 40px 10px 14px;
  font-size: 14px;
  font-weight: 600;
  border-color: #e2e8f0;
  background: #fff;
}
.settings-filter-field .wo-search-select .wo-ss-dropdown {
  z-index: 40;
}
.settings-filter-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex: 0 0 auto;
  padding-bottom: 0;
}
.settings-user-activity-filters .btn {
  min-height: 44px;
  flex: 0 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}
.settings-user-activity-reset {
  min-width: 96px;
}
.settings-user-activity-print-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  border-radius: 999px;
  align-self: end;
}
.settings-user-activity-print-btn svg {
  width: 18px;
  height: 18px;
}
#settingsUserActivityPrint:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.settings-user-activity-list {
  display: grid;
  gap: 18px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 24px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}
.settings-user-activity-list > .settings-empty {
  margin: auto;
  padding: 48px 16px;
}
.settings-user-activity-summary {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}
.settings-user-activity-card {
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  padding: 20px;
  display: grid;
  gap: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.settings-user-activity-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 4px;
}
.settings-activity-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.settings-activity-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.settings-user-activity-card-head h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.settings-user-activity-card-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-user-activity-total {
  text-align: right;
  padding: 10px 14px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  flex-shrink: 0;
}
.settings-user-activity-total strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: -0.02em;
}
.settings-user-activity-total span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.settings-user-activity-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.settings-activity-stat {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: #f8fafc;
  min-width: 0;
}
.settings-activity-stat span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.settings-activity-stat strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-word;
}
.settings-activity-stat-range strong {
  font-size: 14px;
  font-weight: 700;
}
.settings-activity-panel {
  border: 1px solid #eef2f7;
  border-radius: 16px;
  background: #fbfdff;
  padding: 14px 16px 16px;
  display: grid;
  gap: 12px;
}
.settings-activity-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settings-activity-panel-head h5 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #334155;
}
.settings-activity-panel-head span {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
}
.settings-activity-module-grid,
.settings-activity-daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.settings-activity-module-card,
.settings-activity-daily-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.settings-activity-module-card span,
.settings-activity-daily-card span {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.settings-activity-module-card strong,
.settings-activity-daily-card strong {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.settings-activity-wo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-activity-wo-chips-modal {
  padding: 4px 2px 8px;
}
.settings-activity-wo-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}
.settings-activity-open-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.settings-activity-open-card:hover:not(:disabled) {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}
.settings-activity-open-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.settings-activity-open-card:disabled {
  cursor: default;
  opacity: 0.72;
  box-shadow: none;
  transform: none;
}
.settings-activity-open-card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.settings-activity-open-card-copy h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
}
.settings-activity-open-card-copy p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}
.settings-activity-open-card-count {
  flex: 0 0 auto;
  min-width: 56px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.settings-activity-open-card-audit .settings-activity-open-card-count {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
.settings-activity-detail-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 24px));
  max-height: min(88vh, 760px);
  z-index: 91;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.settings-activity-detail-modal.hidden {
  display: none;
}
.settings-activity-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #eef2f7;
}
.settings-activity-detail-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}
.settings-activity-detail-head p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.settings-activity-detail-body {
  padding: 16px 20px 20px;
  overflow: auto;
  display: grid;
  gap: 12px;
}
.settings-activity-actions {
  display: grid;
  gap: 12px;
}
.settings-activity-actions-list {
  display: grid;
  gap: 10px;
}
.settings-activity-action-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.settings-activity-action-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.settings-activity-action-meta time {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.settings-activity-action-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.settings-activity-action-card strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}
.settings-activity-action-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.settings-activity-actions-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}
.settings-activity-actions-pager > span {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.settings-activity-actions-pager-btns {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.settings-activity-actions-pager-btns strong {
  font-size: 13px;
  color: #334155;
  min-width: 52px;
  text-align: center;
}
.settings-activity-actions-pager-btns .btn {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}
.settings-activity-actions-pager-btns .btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.settings-activity-actions-pager-btns .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.settings-activity-panel .settings-empty {
  margin: 0;
  padding: 18px 8px;
  text-align: center;
}
@media (max-width: 900px) {
  .settings-user-activity-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-user-activity-card-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .settings-user-activity-total {
    width: 100%;
    text-align: left;
  }
}
body[data-page="settings"] .app-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - var(--topnav-h, 64px));
  max-height: calc(100vh - var(--topnav-h, 64px));
  box-sizing: border-box;
}
.app-main > .settings-activity-dashboard-page.crud-page,
body[data-page="settings"] .settings-activity-dashboard-page.crud-page {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 28px;
  overscroll-behavior: contain;
}
.settings-activity-dashboard-page .table-panel,
.app-main > .settings-activity-dashboard-page.crud-page .table-panel {
  flex: 0 0 auto !important;
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  position: relative;
}
.settings-activity-dashboard-page .table-panel.is-loading {
  overflow: hidden !important;
  min-height: min(70vh, 720px);
}
.settings-activity-dashboard-page .table-panel.is-loading > .page-orbit-loader {
  display: none !important;
}
.settings-activity-dashboard-page .table-panel.is-loading > .settings-activity-dashboard-shield {
  visibility: visible;
  pointer-events: auto;
}
.settings-activity-dashboard-shield {
  padding: 16px 0 8px;
}
.settings-activity-dashboard-shield.hidden {
  display: none !important;
}
.settings-activity-dashboard-content.is-shielded {
  display: none !important;
}
.settings-activity-dashboard-kpis--skeleton {
  margin-bottom: 4px;
}
.settings-activity-kpi--skeleton {
  min-height: 84px;
}
.settings-activity-skel-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: block;
}
.settings-activity-skel-line {
  display: block;
  border-radius: 999px;
  height: 12px;
}
.settings-activity-skel-line--xs { width: 72px; height: 10px; }
.settings-activity-skel-line--sm { width: 96px; margin-top: 8px; }
.settings-activity-skel-line--md { width: 140px; height: 14px; }
.settings-activity-skel-line--lg { width: 88px; height: 22px; margin-top: 10px; }
.settings-activity-skel-line--title { width: 140px; height: 18px; }
.settings-activity-skel-line--sub { width: 180px; height: 12px; margin-top: 8px; }
.settings-activity-skel-rank {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: block;
}
.settings-activity-top-row--skeleton {
  pointer-events: none;
}
.settings-activity-skel-chart {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  display: block;
}
.settings-activity-day-highlights {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}
.settings-activity-day-highlights--skeleton {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.settings-activity-day-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.settings-activity-day-stat {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  min-width: 0;
}
.settings-activity-day-stat span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.settings-activity-day-stat strong {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  word-break: break-word;
}
.settings-activity-day-stat small {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}
.settings-activity-busy-days {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px 14px 14px;
  display: grid;
  gap: 12px;
}
.settings-activity-busy-days-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.settings-activity-busy-days-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.settings-activity-busy-days-list {
  display: grid;
  gap: 10px;
}
.settings-activity-busy-day {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.settings-activity-busy-day-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.settings-activity-busy-day-meta strong {
  font-size: 13px;
  color: #0f172a;
}
.settings-activity-busy-day-meta span {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-activity-busy-day-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.settings-activity-busy-day-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0d9488);
}
.settings-activity-busy-day small {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}
.settings-activity-hero {
  align-items: flex-start;
  gap: 16px;
}
.settings-activity-hero-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-activity-dashboard-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.settings-activity-dashboard-toolbar .settings-filter-field {
  margin: 0;
  min-width: 170px;
  flex: 0 0 auto;
  gap: 6px;
}
.settings-activity-dashboard-toolbar .settings-filter-field input {
  min-height: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  box-sizing: border-box;
}
.settings-activity-dashboard-toolbar .btn {
  height: 44px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.08em;
}
.settings-activity-dashboard-toolbar .btn-light {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
  text-decoration: none;
}
.settings-activity-dashboard-toolbar .btn-light:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  text-decoration: none;
}
.settings-activity-refresh-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0 !important;
}
.settings-activity-refresh-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-activity-users-banner-wrap {
  position: relative;
  width: min(420px, 100%);
  z-index: 40;
}
.settings-activity-users-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 70%);
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.settings-activity-users-banner:hover,
.settings-activity-users-banner.is-open {
  border-color: #60a5fa;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}
.settings-activity-users-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  background: #dbeafe;
  color: #1d4ed8;
}
.settings-activity-users-banner-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-activity-users-banner-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-activity-users-banner-copy strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.settings-activity-users-banner-copy small {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}
.settings-activity-users-banner-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1d4ed8;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.settings-activity-users-banner-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  margin-bottom: 4px;
}
.settings-activity-users-banner.is-open .settings-activity-users-banner-caret {
  transform: rotate(-135deg);
  margin-bottom: 0;
  margin-top: 4px;
}
.settings-activity-users-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  overflow: visible;
  padding: 12px;
}
.settings-activity-users-dropdown.hidden {
  display: none;
}
.settings-activity-users-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.settings-activity-users-dropdown-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}
.settings-activity-users-dropdown .settings-activity-users-search {
  min-width: 0;
  width: 150px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
}
.settings-activity-users-dropdown-list {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}
.settings-activity-user-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f8fafc;
  cursor: default;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.settings-activity-user-row:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  z-index: 5;
}
.settings-activity-user-row-copy {
  min-width: 0;
  flex: 1;
}
.settings-activity-user-row-copy strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-activity-user-row-copy span {
  display: block;
  color: #64748b;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-activity-user-avatar--sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 11px;
  flex: 0 0 34px;
}
.settings-activity-user-hovercard {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: auto;
  min-height: 100%;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 60;
}
.settings-activity-user-row:hover .settings-activity-user-hovercard {
  opacity: 1;
  visibility: visible;
}
/* Near the bottom of the list: keep card inside view by anchoring upward. */
.settings-activity-user-row:nth-last-child(-n+3) .settings-activity-user-hovercard {
  top: auto;
  bottom: 0;
}
.settings-activity-user-hovercard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.settings-activity-user-hovercard-head strong {
  color: #0f172a;
  font-size: 14px;
}
.settings-activity-user-hovercard-info {
  display: grid;
  gap: 8px;
}
.settings-activity-user-hovercard-info span {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.settings-activity-user-hovercard-info strong {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}
.settings-activity-dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 0;
}
.settings-activity-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.settings-activity-kpi > div {
  min-width: 0;
}
.settings-activity-kpi span:not(.settings-activity-kpi-icon) {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.settings-activity-kpi strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}
.settings-activity-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
}
.settings-activity-kpi-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-activity-kpi-icon--blue {
  background: #eff6ff;
  color: #2563eb;
}
.settings-activity-kpi-icon--violet {
  background: #f5f3ff;
  color: #7c3aed;
}
.settings-activity-kpi-icon--amber {
  background: #fffbeb;
  color: #d97706;
}
.settings-activity-kpi-icon--teal {
  background: #f0fdfa;
  color: #0d9488;
}
.settings-activity-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px 18px 22px;
}
.settings-activity-chart-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
}
.settings-activity-chart-card-span {
  grid-column: 1 / -1;
}
.settings-activity-chart-card header h3 {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}
.settings-activity-chart-card header p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}
.settings-activity-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}
.settings-activity-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  flex: 0 0 auto;
}
.settings-activity-role-pill.is-admin {
  background: #fef3c7;
  color: #b45309;
}
.settings-activity-role-pill.is-user {
  background: #e0f2fe;
  color: #0369a1;
}
.settings-activity-chart-wrap {
  position: relative;
  height: 260px;
  margin-top: 12px;
}
.settings-activity-chart-wrap-wide {
  height: 320px;
}
.settings-activity-top-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.settings-activity-top-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.settings-activity-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 12px;
}
.settings-activity-top-row strong {
  display: block;
  color: #0f172a;
}
.settings-activity-top-row p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 12px;
}
.settings-activity-top-metrics {
  text-align: right;
}
.settings-activity-top-metrics span {
  display: block;
  font-weight: 800;
  color: #0f172a;
}
.settings-activity-top-metrics small {
  color: #64748b;
  font-size: 11px;
}
.settings-activity-chart-card-table .table-scroll {
  margin-top: 12px;
  max-height: 360px;
}
.settings-activity-chart-card-table tr.is-weekend-row td {
  background: #fff7ed;
}
@media (max-width: 1100px) {
  .settings-activity-dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-activity-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .settings-activity-hero {
    flex-direction: column;
  }
  .settings-activity-users-banner-wrap {
    width: 100%;
  }
  .settings-activity-dashboard-toolbar {
    width: 100%;
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .settings-activity-dashboard-kpis {
    grid-template-columns: 1fr;
  }
  .settings-activity-dashboard-toolbar {
    flex-wrap: wrap;
    width: 100%;
  }
  .settings-activity-dashboard-toolbar .settings-filter-field {
    width: 100%;
    min-width: 0;
  }
  .settings-activity-top-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .settings-activity-top-metrics {
    grid-column: 2;
    text-align: left;
  }
  .settings-activity-day-stats,
  .settings-activity-day-highlights--skeleton {
    grid-template-columns: 1fr;
  }
  .settings-activity-busy-day {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .settings-activity-busy-day-bar {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .settings-activity-actions-pager {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-activity-actions-pager-btns {
    justify-content: space-between;
  }
}
.settings-deleted-wo-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 16px;
}
.settings-deleted-wo-view.hidden {
  display: none;
}
.settings-subhead {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 56px;
  margin-bottom: 0;
  padding: 0;
}
.settings-subhead-copy {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(420px, calc(100% - 420px));
  text-align: center;
  pointer-events: none;
}
.settings-subhead h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
}
.settings-subhead p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  text-align: center;
}
.settings-back-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  flex-shrink: 0;
}
.settings-back-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.settings-back-btn svg {
  width: 16px;
  height: 16px;
}
.settings-deleted-wo-search {
  position: relative;
  z-index: 1;
  width: min(340px, 42vw);
  max-width: 340px;
  margin-left: auto;
  flex-shrink: 0;
}
.settings-subhead-spacer {
  width: min(340px, 42vw);
  max-width: 340px;
  margin-left: auto;
  flex-shrink: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 720px) {
  .settings-subhead {
    flex-wrap: wrap;
  }
  .settings-subhead-copy {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    order: 2;
    width: 100%;
    max-width: none;
    pointer-events: auto;
  }
  .settings-back-btn {
    order: 1;
  }
  .settings-deleted-wo-search,
  .settings-subhead-spacer {
    order: 3;
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
  .settings-subhead-spacer {
    display: none;
  }
}
.settings-deleted-wo-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.settings-empty {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
}
.settings-deleted-wo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}
.settings-deleted-wo-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.settings-deleted-wo-main h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.settings-deleted-wo-title {
  margin: 6px 0 0;
  font-size: 14px;
  color: #475569;
}
.settings-deleted-wo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: #64748b;
}
.settings-deleted-wo-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .settings-deleted-wo-card {
    flex-direction: column;
    align-items: stretch;
  }
}
html:has(body.app-embed),
body.app-embed {
  height: 100%;
  width: 100%;
  overflow: hidden;
}
body.app-embed .topnav,
body.app-embed .topnav-backdrop,
body.app-embed .profile-modal,
body.app-embed .profile-modal-overlay {
  display: none !important;
}
body.app-embed .app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-height: 100%;
  min-width: 0;
}
body.app-embed .content {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: auto;
  overflow: hidden;
}
body.app-embed .app-main {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  padding-left: 0 !important;
  padding-top: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column;
}
body.app-embed .crud-page,
body.app-embed .audit-logs-page,
body.app-embed .access-page {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  gap: 0;
  overflow: hidden;
}
body.app-embed .page-hero-card {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  padding: 12px 16px;
  box-shadow: none;
}
body.app-embed .access-list-panel,
body.app-embed .crud-page > .table-panel,
body.app-embed .audit-logs-page > .table-panel,
body.app-embed .access-page > .table-panel {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: none;
  max-height: none !important;
  margin: 0;
  padding: 0 !important;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.app-embed .access-list-head,
body.app-embed .table-panel > .table-list-pagination,
body.app-embed .table-panel > .list-pagination,
body.app-embed .access-list-panel > .table-list-pagination,
body.app-embed .access-list-panel > .list-pagination {
  padding-left: 16px;
  padding-right: 16px;
}
body.app-embed .access-list-scroll,
body.app-embed .table-panel .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.app-embed .data-table {
  width: 100%;
}
body.app-embed .audit-log-table {
  min-width: max(100%, 1100px);
}
body.app-embed .audit-log-details {
  max-width: none;
  white-space: normal;
}
body.app-embed .audit-log-ip {
  white-space: nowrap;
}
body.app-embed .table-panel .table-list-pagination,
body.app-embed .table-panel .list-pagination {
  width: 100%;
}
.profile-requests-empty,
.profile-requests-error {
  margin: 28px 12px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}
.profile-request-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}
.profile-request-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-request-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #2563eb;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: -0.03em;
}
.profile-request-identity {
  min-width: 0;
}
.profile-request-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2563eb;
}
.profile-request-identity h5 {
  margin: 4px 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-request-facts {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-request-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.profile-request-accept,
.profile-request-reject {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.profile-request-accept {
  border: 0;
  background: #2563eb;
  color: #fff;
}
.profile-request-accept:hover {
  background: #1d4ed8;
}
.profile-request-reject {
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
}
.profile-request-reject:hover {
  background: #fef2f2;
}
.profile-requests-badge {
  position: absolute;
  top: -2px;
  left: 26px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
  z-index: 2;
}
.profile-requests-badge.is-pulse,
.profile-shortcut-count.is-pulse {
  animation: emails-badge-pulse 0.85s ease;
}
@media (max-width: 640px) {
  .profile-shortcut-btn {
    width: 32px;
    height: 32px;
  }
}
.profile-modal-role {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 6px 0 0; font-size: 15px; font-weight: 600; color: #2563eb;
}
.profile-role-icon { width: 16px; height: 16px; flex-shrink: 0; }
.profile-details { display: flex; flex-direction: column; gap: 16px; }
.profile-detail {
  display: flex; align-items: center; gap: 16px;
  background: #f9fafb; border: 1px solid #f3f4f6;
  border-radius: 16px; padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.profile-detail:hover {
  border-color: #e5e7eb; box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.profile-detail-icon-wrap {
  flex-shrink: 0; width: 40px; height: 40px;
  display: grid; place-items: center;
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15,23,42,.08);
  color: #9ca3af;
}
.profile-detail-icon-wrap svg { width: 20px; height: 20px; }
.profile-detail-text { min-width: 0; flex: 1; }
.profile-detail-label {
  margin: 0; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: #6b7280;
}
.profile-detail-value {
  margin: 2px 0 0; font-size: 14px; font-weight: 700; color: #111827;
  word-break: break-all; line-height: 1.35;
}

.access-page { gap: 16px; }
.access-hero .page-hero-actions.access-hero-actions {
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.access-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.access-hero-search {
  min-width: 220px;
  max-width: 280px;
}
.access-metric-card {
  min-width: 100px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.access-metric-card-admin {
  border-color: #ddd6fe;
  background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%);
}
.access-metric-card-user {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #f0f9ff 100%);
}
.access-metric-card span {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: #111827;
  line-height: 1.1;
}
.access-metric-card small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}
.access-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; }
.access-invite-panel,
.access-list-panel {
  padding: 20px;
}
.access-panel-head h3,
.access-list-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}
.access-list-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}
.access-panel-head p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
}
.access-form { display: grid; gap: 10px; }
.access-modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}
.access-tip {
  margin: 0 0 4px;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px 12px;
}
.access-list-panel {
  position: relative;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.access-list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.access-list-head .search-wrap { min-width: 220px; max-width: 300px; }
.access-list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.access-table { min-width: 680px; }
.access-table tbody tr.access-row:hover {
  background: #f8fafc;
}
.access-table td {
  vertical-align: middle;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.access-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.access-user-name {
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.access-email-cell {
  color: #475569;
  font-weight: 600;
}
.access-avatar-shell {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.access-avatar-shell:has(.access-avatar-img:not(.hidden)) {
  cursor: zoom-in;
}
.access-avatar-shell:has(.access-avatar-img:not(.hidden)):hover {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.access-avatar-initial {
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}
.access-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.access-role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.access-role-badge.admin {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}
.access-role-badge.user {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}
.access-role-badge.pending {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.access-role-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.access-role-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.access-role-option:hover:not(.active) {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.access-role-option.active {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.access-role-option[data-value="admin"].active {
  border-color: #7c3aed;
  background: linear-gradient(180deg, #f5f3ff 0%, #faf8ff 100%);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.access-role-option-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.access-role-option-desc {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}
.access-role-option.active .access-role-option-title {
  color: #1d4ed8;
}
.access-role-option[data-value="admin"].active .access-role-option-title {
  color: #6d28d9;
}
.access-role-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.access-perms-section { display: grid; gap: 10px; }
.access-perms-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.access-perms-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.access-perms-matrix {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: auto;
  max-height: 320px;
  background: #fff;
}
.access-perms-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 56px 56px 56px 56px 96px;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid #f1f5f9;
}
.access-perms-header {
  border-top: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.access-perms-header span:not(:first-child) { text-align: center; }
.access-perms-module {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.access-perms-module-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.access-perms-module-path {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}
.access-perm-check {
  display: flex;
  justify-content: center;
  cursor: pointer;
}
.access-perm-check input {
  width: 16px;
  height: 16px;
  accent-color: #dc2626;
  cursor: pointer;
}
.access-perm-check input:disabled { cursor: not-allowed; }
.access-perm-na {
  text-align: center;
  color: #9ca3af;
  font-weight: 600;
}
.access-perms-badge {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.access-perms-badge.full {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.access-perms-badge.view {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}
.access-perms-badge.limited {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}
.access-perms-badge.hidden {
  background: transparent;
  color: #9ca3af;
  text-transform: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 4px 0;
}
.access-perms-admin .access-perms-row:not(.access-perms-header) { opacity: 0.55; }

.categories-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.5fr);
  gap: 0;
}
.categories-panel,
.table-panel-loading-host {
  min-height: 280px;
}
.table-panel-loading-host .table-scroll {
  min-height: 220px;
}
.data-table tr.empty-row td {
  text-align: center !important;
  vertical-align: middle;
}
.part-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.part-image-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.part-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.part-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.75);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.part-view-body .part-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.part-view-body .part-view-thumb {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.part-view-body .part-view-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.part-view-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.part-view-qr-wrap .part-view-qr {
    display: block;
    width: 160px;
    height: 160px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.part-view-download:hover {
  text-decoration: underline;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  align-content: start;
}
.category-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.category-card:hover {
  border-color: #dbeafe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}
.category-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.category-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-card-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.category-card-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.category-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}
.category-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-card-meta {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
}
.category-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: auto;
}
.categories-empty {
  grid-column: 1 / -1;
  padding: 48px 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
}
.category-icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.category-icon-option {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  background: transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.category-icon-option:hover {
  transform: translateY(-1px);
}
.category-icon-option.is-selected {
  border-color: #111827;
}
.category-icon-option-inner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.category-icon-option-inner svg {
  width: 22px;
  height: 22px;
  display: block;
}
.category-upload-link {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.category-upload-link:hover {
  text-decoration: underline;
}
.category-custom-icon-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.category-custom-icon-preview img {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #111827;
  background: #f9fafb;
}
.category-modal-form .modal-footer {
  margin-top: 0;
}

.part-modal-form .part-name-input {
  border: 0;
  border-bottom: 2px solid #e2e8f0;
  border-radius: 0;
  padding: 10px 0 12px;
  font-size: 20px;
  font-weight: 800;
  background: transparent;
  box-shadow: none;
  min-height: auto;
}
.part-modal-form .part-name-input:focus {
  border-bottom-color: #2563eb;
  box-shadow: none;
}
.part-image-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.part-image-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.part-generate-link {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.part-generate-link:hover {
  text-decoration: underline;
}
.part-qr-preview {
  margin-top: 12px;
}
.part-qr-preview img {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  background: #fff;
}
.part-stock-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr;
  gap: 12px;
}
.part-files-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #2563eb;
  border-radius: 10px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.part-attachments-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.part-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  background: #fff;
}
.part-attachment-actions {
  display: inline-flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.vendor-attachments-section .field-hint {
  margin: 0 0 0.75rem;
  color: #64748b;
  font-size: 0.9rem;
}
.vendor-attachments-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.vendor-attachments-toolbar .communication-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border: 1px dashed #93c5fd;
  border-radius: 0.65rem;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}
.vendor-attachments-toolbar .communication-attach-btn:hover {
  background: #dbeafe;
}
.vendor-attachments-toolbar .communication-attach-btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vendor-attachments-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0;
  min-height: 1.5rem;
}
.vendor-attachment-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.vendor-attachment-row .communication-file-chip {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.vendor-attachment-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #fecaca;
  border-radius: 0.55rem;
  background: #fff1f2;
  color: #be123c;
  cursor: pointer;
  flex-shrink: 0;
}
.vendor-attachment-remove:hover {
  background: #ffe4e6;
}
.vendor-attachment-remove svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vendor-attachments-empty {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}
.ss-option-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ss-option-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ss-option-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.ss-option-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}
.wo-ss-trigger .ss-option-with-icon {
  justify-content: flex-start;
}
.wo-ss-tag .ss-option-with-icon {
  gap: 6px;
}
.wo-ss-tag .ss-option-icon {
  width: 22px;
  height: 22px;
}
.wo-images-grid {
  margin-top: 10px;
}

.categories-list-wrap {
  border-right: 1px solid #e5e7eb;
  min-height: 0;
  max-height: calc(100vh - 220px);
  overflow: auto;
}
.categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.categories-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.categories-item-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}
.categories-item-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}
.categories-form-wrap {
  padding: 16px;
}
.categories-actions .action-btn {
  width: 32px;
  height: 32px;
}

@media (max-width: 900px) {
  .access-hero-metrics { justify-content: flex-start; }
  .access-list-head { flex-wrap: wrap; }
  .access-list-head .search-wrap {
    min-width: 100%;
    max-width: 100%;
  }
  .access-list-panel { max-height: none; }
  .categories-layout {
    grid-template-columns: 1fr;
  }
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .part-stock-row {
    grid-template-columns: 1fr 1fr;
  }
  .categories-list-wrap {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }
}

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  background: #111827; color: #fff; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(15,23,42,.25);
}
.toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}
.upload-progress-host {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 4001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: min(340px, calc(100vw - 32px));
}
.upload-card {
  position: relative;
  width: 320px;
  max-width: 100%;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.8) inset,
    0 -1px 0 rgba(15, 23, 42, 0.06) inset;
  border: 1px solid #e2e8f0;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
  overflow: hidden;
}
.upload-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.upload-card-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 90px;
  background: radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.28), transparent 65%);
  pointer-events: none;
}
.upload-info {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}
.upload-info .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.upload-info .percent-text {
  flex-shrink: 0;
  color: #2563eb;
  font-variant-numeric: tabular-nums;
}
.progress-bar-bg {
  position: relative;
  width: 100%;
  height: 10px;
  background-color: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb 55%, #1d4ed8);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.45);
  transition: width 0.2s ease-in-out;
}
.upload-card-status {
  position: relative;
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.upload-card.is-complete .percent-text,
.upload-card.is-complete .upload-card-status { color: #15803d; }
.upload-card.is-complete .progress-bar-fill {
  background: linear-gradient(90deg, #34d399, #16a34a);
  box-shadow: 0 0 12px rgba(22, 163, 74, 0.35);
}
.upload-card.is-error .percent-text,
.upload-card.is-error .upload-card-status { color: #b91c1c; }
.upload-card.is-error .progress-bar-fill {
  background: linear-gradient(90deg, #f87171, #dc2626);
  box-shadow: none;
}
.toast-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: auto;
}
.toast-card.show { opacity: 1; transform: translateY(0); }
.toast-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
}
.toast-success .toast-card-icon { background: #dcfce7; color: #15803d; }
.toast-error .toast-card-icon { background: #fee2e2; color: #b91c1c; }
.toast-warning .toast-card-icon { background: #fef3c7; color: #b45309; }
.toast-info .toast-card-icon { background: #dbeafe; color: #1d4ed8; }
.toast-loading .toast-card-icon {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  color: transparent;
  animation: googleSignInSpin .7s linear infinite;
}
.toast-card-text { line-height: 1.4; }
.auth-processing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 300px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
}
.auth-processing-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: googleSignInSpin .7s linear infinite;
  flex-shrink: 0;
}

/* APP SHELL — React parity */
.app-shell { min-height: 100vh; display: flex; background: #f9fafb; }
.sidebar {
  width: 256px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 24px 24px 0; border-bottom: 1px solid #e5e7eb;
}
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; border: 0; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 0; background: transparent;
  display: grid; place-items: center; font-size: 28px;
}
.brand h1 { margin: 0; font-size: 16px; font-weight: 800; color: #111827; }
.brand p { margin: 2px 0 0; color: #6b7280; font-size: 12px; }
.sidebar-close-btn {
  border: 0; background: #f3f4f6; border-radius: 8px; width: 32px; height: 32px;
  cursor: pointer; font-size: 18px; color: #9ca3af; margin-top: 4px;
}
.mini-calendar { padding: 24px; border-bottom: 1px solid #f3f4f6; }
.mini-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mini-cal-head > p { margin: 0; font-size: 10px; color: #9ca3af; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; }
.mini-cal-month-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.mini-cal-nav {
  border: 0; background: transparent; color: #9ca3af; font-size: 14px; cursor: pointer;
  padding: 4px; border-radius: 6px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mini-cal-nav:hover { background: #f3f4f6; color: #2563eb; }
.mini-cal-month {
  background: #eff6ff !important; color: #2563eb !important;
  padding: 2px 8px; border-radius: 6px; font-size: 12px !important;
  font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important;
  min-width: 3rem;
  width: 3rem;
  text-align: center;
  flex-shrink: 0;
}
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mini-cal-dow { font-size: 10px; font-weight: 800; color: #9ca3af; }
.mini-cal-day {
  font-size: 11px; font-weight: 600; color: #4b5563; height: 24px; width: 24px;
  margin: 0 auto; display: grid; place-items: center; border-radius: 999px; cursor: pointer; border: 0; background: transparent;
}
.mini-cal-day:hover { background: #f3f4f6; }
.mini-cal-day.active { background: #2563eb; color: #fff; font-weight: 800; box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.mini-cal-day.today-ring { box-shadow: 0 0 0 2px #2563eb; color: #2563eb; font-weight: 800; }

.nav-links { flex: 1; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-link {
  text-decoration: none; color: #374151; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px;
}
.nav-link:hover { background: #f9fafb; }
.nav-link.active { background: #eff6ff; color: #2563eb; }
.nav-link.active .nav-svg { stroke: #2563eb; }
.nav-svg { width: 20px; height: 20px; stroke: #6b7280; fill: none; stroke-width: 2; flex-shrink: 0; }

.users-nav { margin-top: 8px; }
.users-toggle {
  border: 0; width: 100%; text-align: left; padding: 10px 16px; border-radius: 8px;
  background: transparent; color: #374151; font-weight: 600; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
}
.users-toggle:hover, .users-toggle.open { background: #f9fafb; }
.users-toggle.open { background: #eff6ff; color: #2563eb; }
.users-chevron { margin-left: auto; font-size: 14px; color: #9ca3af; transition: transform .2s; }
.users-chevron.open { transform: rotate(90deg); }
.users-subnav { margin: 4px 0 0 16px; padding-left: 12px; border-left: 1px solid #f3f4f6; display: none; }
.users-subnav.open { display: block; }
.users-subnav .nav-link { font-size: 14px; padding: 8px 16px; }

.sidebar-user { padding: 16px; border-top: 1px solid #e5e7eb; margin-top: auto; }
.sidebar-user-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.sidebar-logout-btn {
  flex-shrink: 0;
  width: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-logout-btn svg { width: 22px; height: 22px; }
.sidebar-logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.34);
}
.profile-btn {
  flex: 1;
  min-width: 0;
  width: auto;
  border: 0;
  border-radius: 12px;
  background: #f9fafb;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  cursor: pointer;
}
.profile-btn:hover { background: #f3f4f6; }
.profile-btn-copy { min-width: 0; flex: 1; }
.profile-avatar-shell {
  width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center;
  background: #2563eb; overflow: hidden; flex-shrink: 0;
}
#profileInitial { color: #fff; font-weight: 700; font-size: 12px; }
.profile-btn p { margin: 0; text-align: left; }
#profileName { font-size: 12px; font-weight: 800; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#profileRole { font-size: 10px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { flex: 1; min-width: 0; overflow: hidden; }
.app-main { padding: 24px; padding-left: 64px; overflow: hidden; height: 100vh; }

body[data-page="locations"] .app-main,
body[data-page="employees"] .app-main,
body[data-page="vendors"] .app-main,
body[data-page="vendor-map"] .app-main,
body[data-page="chart-of-accounts"] .app-main,
body[data-page="access"] .app-main,
body[data-page="communication"] .app-main,
body[data-page="dashboard"] .app-main,
body[data-page="jha"] .app-main,
body[data-page="proposal"] .app-main,
body[data-page="checklists"] .app-main,
body[data-page="cost-management"] .app-main,
body[data-page="vendor-billing"] .app-main,
body[data-page="amazon-billing"] .app-main,
body[data-page="inventory-parts"] .app-main,
body[data-page="categories"] .app-main,
body[data-page="part-types"] .app-main,
body[data-page="inventory-teams"] .app-main,
body[data-page="work-order-show"] .app-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body[data-page="tracking"] .app-main {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topnav-h));
  overflow: hidden;
  padding-bottom: 16px;
  box-sizing: border-box;
}

.crud-page,
.tracking-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 18px;
  overflow: hidden;
}

.crud-page .page-hero-card,
.crud-page .alert { flex-shrink: 0; margin-bottom: 0; }

.tracking-page .tracking-header-row { flex-shrink: 0; margin-bottom: 0; }
.tracking-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
}
.tracking-header-spacer { min-width: 0; }
.tracking-island {
  display: flex;
  justify-content: center;
  justify-self: center;
  z-index: 5;
}
.tracking-island-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  max-width: min(420px, 72vw);
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eef2f7;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition:
    max-width .32s cubic-bezier(.2,.9,.2,1),
    padding .28s cubic-bezier(.2,.9,.2,1),
    background .2s ease,
    color .2s ease,
    border-color .2s ease,
    box-shadow .28s cubic-bezier(.2,.9,.2,1),
    transform .28s cubic-bezier(.2,.9,.2,1);
  overflow: hidden;
  white-space: nowrap;
}
.tracking-island-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tracking-island-message {
  display: inline-flex;
  align-items: center;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tracking-island-pill.is-socket-live {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.tracking-island-pill.is-expanded {
  max-width: min(420px, 86vw);
  padding: 10px 18px;
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
  transform: translateY(-1px) scale(1.02);
}
.tracking-island-pill.is-expanded .live-dot {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.22);
}
.tracking-island-pill.is-expanded .tracking-island-live {
  display: none;
}
@media (max-width: 640px) {
  .tracking-header-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 10px;
  }
  .tracking-island {
    justify-self: center;
  }
  .tracking-header-spacer { display: none; }
  .tracking-island-message { max-width: 70vw; }
}

body[data-page="tracking"] .tracking-page {
  flex: 1;
  min-height: 0;
  gap: 16px;
  padding-bottom: 0;
  overflow: hidden;
}
.dashboard-page, .calendar-page { display: flex; flex-direction: column; gap: 32px; padding-bottom: 16px; }

/* Welcome banner */
.welcome-banner {
  position: relative; overflow: hidden; border-radius: 36px;
  background: linear-gradient(135deg, #0f172a 0%, #172554 45%, #312e81 100%);
  padding: 32px 40px; box-shadow: 0 25px 50px rgba(15,23,42,.18), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.welcome-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at top right, rgba(59,130,246,.22) 0%, transparent 55%);
}
.welcome-banner-glow { position: absolute; border-radius: 999px; pointer-events: none; filter: blur(48px); }
.welcome-banner-glow-a { width: 224px; height: 224px; background: rgba(59,130,246,.22); top: -80px; right: -80px; }
.welcome-banner-glow-b { width: 192px; height: 192px; background: rgba(99,102,241,.18); bottom: -64px; left: -64px; }
.welcome-banner-inner {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 32px;
}
.welcome-date { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: rgba(191,219,254,.92); }
.welcome-sparkle { width: 16px; height: 16px; color: #fcd34d; flex-shrink: 0; }
.welcome-greeting { margin: 0; font-size: clamp(28px, 4vw, 44px); font-weight: 900; color: #fff; letter-spacing: -0.02em; line-height: 1.15; }
.welcome-name {
  background: linear-gradient(90deg, #fde68a, #fcd34d); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.welcome-widgets { display: flex; flex-wrap: wrap; gap: 12px; }
.welcome-widget {
  min-width: 140px; border-radius: 24px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.1); backdrop-filter: blur(12px); padding: 20px 24px; text-align: center;
  transition: background .2s, border-color .2s, transform .2s;
}
.welcome-widget-upcoming {
  text-decoration: none; color: inherit;
  background: linear-gradient(135deg, rgba(251,191,36,.22), rgba(249,115,22,.12));
  border-color: rgba(252,211,77,.35);
}
.welcome-widget-upcoming:hover {
  background: linear-gradient(135deg, rgba(251,191,36,.32), rgba(249,115,22,.18));
  border-color: rgba(252,211,77,.5); transform: translateY(-1px);
}
.welcome-widget-value { margin: 0; font-size: clamp(28px, 4vw, 36px); font-weight: 900; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.welcome-widget-icon-svg { display: flex; justify-content: center; margin: 0 auto 6px; color: #fde68a; }
.welcome-widget-icon-svg svg { width: 20px; height: 20px; }
.welcome-widget-label { margin: 4px 0 0; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2em; color: rgba(255,255,255,.5); }
.welcome-widget-upcoming .welcome-widget-label { color: rgba(254,243,199,.85); }

/* Snapshot stats */
.snapshot-section h2 { margin: 0; font-size: 20px; font-weight: 900; color: #111827; letter-spacing: -0.02em; }
.snapshot-section > .snapshot-head p, .snapshot-head p { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: #6b7280; }
.snapshot-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; gap: 12px; }
.sync-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #9ca3af; }
.sync-spinner {
  width: 14px; height: 14px; border: 2px solid #dbeafe; border-top-color: #2563eb;
  border-radius: 999px; animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stats-grid-react {
  display: grid; grid-template-columns: repeat(1, 1fr); gap: 16px;
}
@media (min-width: 640px) { .stats-grid-react { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .stats-grid-react { grid-template-columns: repeat(3, 1fr); } }

.stat-card-react {
  position: relative; overflow: hidden; border-radius: 24px; border: 1px solid rgba(243,244,246,.9);
  background: #fff; padding: 20px; box-shadow: 0 1px 3px rgba(15,23,42,.04);
  text-decoration: none; color: inherit; transition: transform .25s, box-shadow .25s;
}
.stat-card-react:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(15,23,42,.1); }
.stat-ring-orange { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(254,215,170,.6); }
.stat-ring-rose { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(254,205,211,.65); }
.stat-ring-violet { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(221,214,254,.65); }
.stat-ring-amber { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(253,230,138,.65); }
.stat-ring-emerald { box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(167,243,208,.65); }
.stat-card-react .stat-glow {
  position: absolute; top: -24px; right: -24px; width: 96px; height: 96px;
  border-radius: 999px; opacity: .08;
}
.stat-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-icon-wrap {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  color: #fff; transition: transform .25s;
}
.stat-card-react:hover .stat-icon-wrap { transform: scale(1.06); }
.stat-icon-svg { width: 20px; height: 20px; display: block; }
.stat-arrow { display: inline-flex; color: #d1d5db; transition: color .2s; }
.stat-arrow-svg { width: 16px; height: 16px; display: block; }
.stat-card-react:hover .stat-arrow { color: #2563eb; }
.stat-card-react .stat-name {
  margin: 16px 0 4px; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: #9ca3af;
}
.stat-card-react .stat-num {
  margin: 0; font-size: 30px; font-weight: 900; color: #111827; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.stat-card-react .stat-foot { margin: 4px 0 0; font-size: 12px; font-weight: 500; color: #6b7280; }
.stat-card-react .stat-bar {
  margin-top: 16px; height: 4px; border-radius: 999px; opacity: .88;
}

.stat-skeleton {
  border-radius: 24px; border: 1px solid #f3f4f6; background: #fff; padding: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}
.stat-skeleton .sk { background: #f3f4f6; border-radius: 8px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* Map + summary row */
.dashboard-map-row {
  display: grid; grid-template-columns: 1fr; gap: 24px;
}
@media (min-width: 1280px) { .dashboard-map-row { grid-template-columns: 1fr 280px; } }

.map-panel {
  overflow: hidden; border-radius: 36px; border: 1px solid #f3f4f6; background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.03);
}
.map-panel-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 20px 32px; border-bottom: 1px solid #f9fafb;
}
.map-panel-head h2 { margin: 0; font-size: 18px; font-weight: 900; color: #111827; }
.map-panel-head p { margin: 2px 0 0; font-size: 12px; font-weight: 500; color: #6b7280; }
.map-panel-canvas { min-height: 380px; background: #f1f5f9; }
.map-panel-canvas iframe { width: 100%; height: 100%; min-height: 380px; border: 0; display: block; }

.btn-pill-dark {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  background: #0f172a; color: #fff; padding: 8px 16px; font-size: 12px; font-weight: 800;
  text-decoration: none; border: 0; transition: background .2s;
}
.btn-pill-dark:hover { background: #1e293b; }
.btn-pill-primary {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px;
  background: #2563eb; color: #fff; padding: 8px 16px; font-size: 14px; font-weight: 800;
  text-decoration: none; border: 0; cursor: pointer; box-shadow: 0 8px 24px rgba(37,99,235,.2);
  transition: background .2s, box-shadow .2s;
}
.btn-pill-primary:hover { background: #1d4ed8; box-shadow: 0 10px 28px rgba(37,99,235,.28); }

.summary-stack-react { display: flex; flex-direction: column; gap: 16px; }
.summary-card-react {
  display: flex; align-items: center; gap: 16px; border-radius: 24px; border: 1px solid #f3f4f6;
  background: #fff; padding: 20px; box-shadow: 0 1px 3px rgba(15,23,42,.04);
  text-decoration: none; color: inherit; transition: box-shadow .25s, transform .25s;
}
.summary-card-react:hover { box-shadow: 0 12px 32px rgba(15,23,42,.08); transform: translateY(-2px); }
.summary-card-icon {
  width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center;
  color: #fff; flex-shrink: 0; transition: transform .25s;
}
.summary-card-react:hover .summary-card-icon { transform: scale(1.05); }
.summary-icon-svg { width: 20px; height: 20px; display: block; }
.summary-card-meta { flex: 1; min-width: 0; }
.summary-card-meta p:first-child {
  margin: 0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #9ca3af;
}
.summary-card-meta p:last-child {
  margin: 2px 0 0; font-size: 24px; font-weight: 900; color: #111827;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.summary-card-arrow { display: inline-flex; color: #d1d5db; transition: color .2s; }
.summary-arrow-svg { width: 16px; height: 16px; display: block; }
.summary-card-react:hover .summary-card-arrow { color: #2563eb; }

.btn-icon { width: 16px; height: 16px; flex-shrink: 0; }
.btn-icon-sm { width: 14px; height: 14px; flex-shrink: 0; }

/* Upcoming panel */
.upcoming-panel {
  overflow: hidden; border-radius: 36px; border: 1px solid #f3f4f6; background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.03);
}
.upcoming-panel-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 20px 32px; border-bottom: 1px solid #f9fafb;
}
.upcoming-panel-head h2 { margin: 0; font-size: 18px; font-weight: 900; color: #111827; }
.upcoming-panel-head p { margin: 2px 0 0; font-size: 12px; font-weight: 500; color: #6b7280; }
.upcoming-panel-body { position: relative; padding: 24px 32px; min-height: 120px; }
.upcoming-item {
  display: flex; align-items: center; gap: 16px; width: 100%; border: 1px solid #f3f4f6;
  border-radius: 16px; background: linear-gradient(90deg, rgba(249,250,251,.8), #fff);
  padding: 16px; margin-bottom: 12px; text-align: left; cursor: pointer;
  transition: border-color .2s, box-shadow .2s; text-decoration: none; color: inherit;
}
.upcoming-item:hover { border-color: #dbeafe; box-shadow: 0 4px 16px rgba(15,23,42,.06); }
.upcoming-dot { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; box-shadow: 0 0 0 2px #fff; }
.upcoming-meta { flex: 1; min-width: 0; }
.upcoming-meta h4 { margin: 0; font-size: 14px; font-weight: 800; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-item:hover .upcoming-meta h4 { color: #1d4ed8; }
.upcoming-meta p { margin: 2px 0 0; font-size: 14px; font-weight: 500; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-chip {
  flex-shrink: 0; border-radius: 999px; border: 1px solid; padding: 4px 12px;
  font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em;
}
.status-chip.Active { background: #eff6ff; color: #2563eb; border-color: #dbeafe; }
.status-chip.Completed { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.status-chip.Pending { background: #fefce8; color: #ca8a04; border-color: #fef08a; }
.status-chip.Processing { background: #faf5ff; color: #9333ea; border-color: #e9d5ff; }
.panel-loader {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.85); z-index: 2;
}

/* Calendar page */
.calendar-toolbar-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 24px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
  overflow: visible;
  position: relative;
  z-index: 4;
}
.calendar-toolbar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.calendar-nav-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 20px;
  min-width: 0;
  justify-self: start;
}
.calendar-nav-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.cal-today-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 10px 22px 10px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #bfdbfe 55%, #93c5fd 100%);
  color: #1e3a8a;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cal-today-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}
.cal-today-icon {
  width: 18px;
  height: 18px;
  color: #2563eb;
  flex-shrink: 0;
}
.cal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 2px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: #374151;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.cal-nav-btn:hover { background: #f3f4f6; color: #2563eb; }
.cal-nav-btn svg { width: 22px; height: 22px; }
.calendar-nav-group h1,
#calendarMonthTitle {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.calendar-nav-group[data-cal-view="month"] h1,
.calendar-nav-group[data-cal-view="month"] #calendarMonthTitle,
.calendar-nav-group[data-cal-view="week"] h1,
.calendar-nav-group[data-cal-view="week"] #calendarMonthTitle {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #111827;
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  min-width: 11.5rem;
}
.calendar-nav-group[data-cal-view="week"] h1,
.calendar-nav-group[data-cal-view="week"] #calendarMonthTitle {
  min-width: 15rem;
}
.calendar-nav-group[data-cal-view="day"] h1,
.calendar-nav-group[data-cal-view="day"] #calendarMonthTitle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 52%, #0891b2 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.32);
  min-width: 12.5rem;
}
.calendar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  justify-self: end;
  min-width: 0;
}
.cal-toolbar-search {
  width: 100%;
  max-width: 280px;
  min-width: 0;
  flex: none;
  justify-self: center;
}
.cal-toolbar-search input {
  min-height: 42px;
  padding: 10px 12px 10px 40px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cal-toolbar-search input:hover {
  border-color: #cbd5e1;
  background: #fff;
}
.cal-toolbar-search input:focus {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.cal-toolbar-selects {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}
.cal-toolbar-select {
  width: 150px;
  flex-shrink: 0;
}
.cal-toolbar-select#calFilterPriority {
  width: 200px;
}
.cal-toolbar-select#calFilterPriority .wo-ss-dropdown {
  min-width: 100%;
  width: max-content;
}
.cal-toolbar-select#calFilterPriority .wo-ss-option {
  white-space: nowrap;
}
.cal-toolbar-select .wo-ss-trigger {
  min-height: 42px;
  padding: 10px 36px 10px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 12px;
  border-color: #e2e8f0;
  background: #f8fafc;
}
.cal-toolbar-select .wo-ss-trigger:hover {
  border-color: #cbd5e1;
  background: #fff;
}
.cal-toolbar-select.open .wo-ss-trigger {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.cal-toolbar-select .wo-ss-dropdown {
  z-index: 90;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
.cal-toolbar-select .wo-ss-option {
  padding: 11px 14px;
  font-weight: 600;
}
.cal-toolbar-selects:has(.cal-toolbar-select.open) {
  position: relative;
  z-index: 95;
}
@media (max-width: 1200px) {
  .calendar-toolbar-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .calendar-nav-group,
  .cal-toolbar-search,
  .calendar-actions {
    justify-self: stretch;
  }
  .cal-toolbar-search {
    max-width: none;
  }
  .calendar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .cal-toolbar-select {
    width: 160px;
  }
  .cal-toolbar-select#calFilterPriority {
    width: 200px;
  }
}
.btn-cal-primary {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 8px; padding: 8px 16px;
  background: #2563eb; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn-cal-primary:hover { background: #1d4ed8; }
.btn-cal-primary svg { width: 16px; height: 16px; flex-shrink: 0; }
.cal-loading { display: inline-flex; align-items: center; }
.cal-loading-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(102,126,234,.1), rgba(118,75,162,.08));
  border: 1px solid rgba(102,126,234,.18);
  font-size: 12px;
  font-weight: 700;
  color: #667eea;
}
.cal-loading-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #667eea;
  box-shadow: 0 0 0 0 rgba(102,126,234,.45);
  animation: cal-badge-pulse 1.4s ease-in-out infinite;
}
@keyframes cal-badge-pulse {
  0%, 100% { transform: scale(.92); box-shadow: 0 0 0 0 rgba(102,126,234,.35); }
  50% { transform: scale(1); box-shadow: 0 0 0 6px rgba(102,126,234,0); }
}

/* Custom view dropdown */
.cal-view-dropdown { position: relative; }
.cal-view-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 120px; padding: 10px 12px 10px 14px;
  border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
  font-size: 14px; font-weight: 700; color: #1f2937; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.cal-view-trigger:hover { border-color: #d1d5db; }
.cal-view-trigger[aria-expanded="true"] {
  border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.cal-view-chevron { width: 16px; height: 16px; color: #9ca3af; transition: transform .2s; flex-shrink: 0; }
.cal-view-dropdown.open .cal-view-chevron { transform: rotate(180deg); }
.cal-view-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: auto; z-index: 50;
  min-width: 100%; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.12);
  animation: calMenuIn .15s ease-out;
}
@keyframes calMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.cal-view-menu li { margin: 0; }
.cal-view-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-weight: 600; color: #374151;
  cursor: pointer; text-align: left; transition: background .15s, color .15s;
}
.cal-view-menu button:hover { background: #eff6ff; color: #1d4ed8; }
.cal-view-menu button.active {
  background: #eff6ff; color: #2563eb; font-weight: 700;
}
.cal-view-menu button.active::before {
  content: ""; width: 14px; height: 14px; flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
}
.cal-view-menu button:not(.active)::before {
  content: ""; width: 14px; height: 14px; flex-shrink: 0;
}
.calendar-actions .cal-view-menu { left: auto; right: 0; }
.calendar-grid-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 0;
  box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: visible;
  position: relative;
}
.calendar-grid-card.is-loading .calendar-grid {
  opacity: .5;
  pointer-events: none;
  filter: saturate(.85);
  transition: opacity .28s ease, filter .28s ease;
}
.cal-grid-loader {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(6px);
  border-radius: 12px;
}
.cal-grid-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cal-grid-loader-inner p {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: .01em;
}
.cal-loader-orbit {
  position: relative;
  width: 48px;
  height: 48px;
}
.cal-loader-orbit span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 3px solid transparent;
}
.cal-loader-orbit span:first-child {
  border-top-color: #667eea;
  border-right-color: #764ba2;
  animation: spin .9s linear infinite;
}
.cal-loader-orbit span:last-child {
  inset: 8px;
  border-bottom-color: #2193b0;
  border-left-color: #6dd5ed;
  animation: spin 1.2s linear infinite reverse;
}
.calendar-grid-card.is-padded { padding: 24px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal-head {
  background: #f9fafb; border-bottom: 1px solid #f3f4f6; padding: 12px 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #6b7280;
  text-align: center; font-weight: 800;
}
.cal-cell {
  min-height: 120px; border-right: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6;
  padding: 8px; background: #fff; vertical-align: top; cursor: pointer;
  transition: background .15s;
}
.cal-cell.cal-day-cell:hover { background: #f9fafb; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.cal-today-cell { box-shadow: inset 0 0 0 2px #2563eb; z-index: 1; }
.cal-date {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; font-size: 12px; font-weight: 700; color: #374151; border-radius: 999px;
  transition: transform .15s;
}
.cal-day-cell:hover .cal-date:not(.today) { transform: scale(1.08); }
.cal-date.today { background: #2563eb; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.cal-empty { background: #fafafa; color: #d1d5db; cursor: default; }
.cal-empty:hover { background: #fafafa; }
.cal-events { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-event {
  font-size: 11px; border-radius: 999px; padding: 4px 10px; color: #fff; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border: 0;
  text-align: left; width: 100%; transition: filter .15s, transform .15s;
}
.cal-event:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cal-more {
  font-size: 11px; font-weight: 800; color: #2563eb; background: none; border: 0;
  cursor: pointer; padding: 4px 2px; text-align: left; transition: color .15s;
}
.cal-more:hover { color: #1d4ed8; text-decoration: underline; }

/* Week view */
.calendar-week-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #f3f4f6;
}
.week-col {
  border-right: 1px solid #f3f4f6; min-height: 360px; background: #fff;
  display: flex; flex-direction: column;
}
.week-col:last-child { border-right: none; }
.week-col-head {
  border-bottom: 1px solid #f3f4f6; padding: 12px 8px; text-align: center; background: #f9fafb;
}
.week-col-head p { margin: 0 0 6px; font-size: 11px; font-weight: 800; color: #6b7280; text-transform: uppercase; letter-spacing: 0.08em; }
.week-col.cal-today-col { box-shadow: inset 0 0 0 2px #2563eb; }
.week-col-body {
  flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: background .15s; overflow-y: auto; max-height: 420px;
}
.week-col-body:hover { background: #fafafa; }
.week-col-body .cal-event { border-radius: 8px; }
.week-empty-hint { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: #d1d5db; text-align: center; }
.day-empty-icon-svg { width: 48px; height: 48px; stroke: #d1d5db; margin-bottom: 12px; }

/* Day view */
.calendar-day-grid { min-height: 480px; background: transparent; border: 0; border-radius: 0; }
.day-view-wrap {
  min-height: 440px; cursor: pointer; transition: background .15s;
}
.day-view-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 400px; color: #9ca3af; text-align: center;
}
.day-view-empty svg { width: 48px; height: 48px; stroke: #d1d5db; margin-bottom: 12px; }
.day-view-empty p { margin: 0; font-size: 15px; font-weight: 600; color: #6b7280; }
.day-view-empty small { margin-top: 6px; font-size: 13px; color: #9ca3af; }
.day-view-wrap { width: 100%; }
.day-view-list { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.day-view-hint { text-align: center; font-size: 12px; color: #9ca3af; margin: 20px 0 0; }

.cal-wo-card {
  display: flex; align-items: stretch; gap: 16px; padding: 16px 20px;
  border: 1px solid #f3f4f6; border-radius: 12px; background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: box-shadow .2s, border-color .2s, transform .15s;
  cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit;
}
.cal-wo-card:hover { box-shadow: 0 4px 16px rgba(15,23,42,.08); border-color: #e5e7eb; transform: translateY(-1px); }
.cal-wo-card:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.cal-wo-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cal-wo-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; background: #f3f4f6; color: #4b5563;
}
.cal-wo-tag.priority-High { background: #fef2f2; color: #b91c1c; }
.cal-wo-tag.priority-Medium { background: #fff7ed; color: #c2410c; }
.cal-wo-tag.priority-Low { background: #eff6ff; color: #1d4ed8; }
.cal-wo-tag.priority-S1 { background: #fef2f2; color: #b91c1c; }
.cal-wo-tag.priority-S2 { background: #fef2f2; color: #b91c1c; }
.cal-wo-tag.priority-S1\|S2 { background: #fef2f2; color: #b91c1c; }
.cal-wo-tag.priority-S3 { background: #fff7ed; color: #c2410c; }
.cal-wo-tag.priority-S4\|S5 { background: #eff6ff; color: #1d4ed8; }
.cal-wo-accent { width: 6px; border-radius: 999px; flex-shrink: 0; align-self: stretch; }
.cal-wo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cal-wo-body h4 {
  margin: 0; font-size: 15px; font-weight: 700; color: #111827;
  line-height: 1.4; word-break: break-word;
}
.cal-wo-body p { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: #6b7280; }
.cal-wo-status {
  flex-shrink: 0; align-self: center; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 0;
  max-width: 150px; text-align: right; line-height: 1.25; color: #6b7280;
}
.cal-wo-status.status-pending { color: #f59e0b; }
.cal-wo-status.status-open { color: #f97316; }
.cal-wo-status.status-need-vendor { color: #ea580c; }
.cal-wo-status.status-scheduling-with-vendor,
.cal-wo-status.status-assigned-to-vendor { color: #0284c7; }
.cal-wo-status.status-proposal-needed,
.cal-wo-status.status-need-proposal { color: #7c3aed; }
.cal-wo-status.status-need-proposal-for-repairs { color: #6d28d9; }
.cal-wo-status.status-proposal-sent { color: #c026d3; }
.cal-wo-status.status-waiting-for-approval { color: #ca8a04; }
.cal-wo-status.status-proposal-not-approved { color: #dc2626; }
.cal-wo-status.status-proposal-approved { color: #0d9488; }
.cal-wo-status.status-approved-needs-scheduling,
.cal-wo-status.status-approved-need-to-scheduled,
.cal-wo-status.status-need-to-schedule { color: #059669; }
.cal-wo-status.status-need-to-reschedule { color: #0891b2; }
.cal-wo-status.status-rescheduled { color: #4f46e5; }
.cal-wo-status.status-hold { color: #78716c; }
.cal-wo-status.status-job-is-done-waiting-for-report { color: #14b8a6; }
.cal-wo-status.status-scheduled,
.cal-wo-status.status-active { color: #2563eb; }
.cal-wo-status.status-approved-waiting-for-parts,
.cal-wo-status.status-parts-needed { color: #e11d48; }
.cal-wo-status.status-processing,
.cal-wo-status.status-in-progress { color: #9333ea; }
.cal-wo-status.status-completed-invoice-needed,
.cal-wo-status.status-work-completed-need-to-invoice { color: #a16207; }
.cal-wo-status.status-completed-need-invoice { color: #d97706; }
.cal-wo-status.status-completed-bill-for-incurred-costs { color: #b45309; }
.cal-wo-status.status-completed-vendor-payment-needed { color: #be185d; }
.cal-wo-status.status-completed-vendor-paid,
.cal-wo-status.status-invoiced { color: #65a30d; }
.cal-wo-status.status-billed { color: #4d7c0f; }
.cal-wo-status.status-completed,
.cal-wo-status.status-complete { color: #15803d; }
.cal-wo-status.status-canceled,
.cal-wo-status.status-cancelled { color: #64748b; }
.cal-wo-status.status-return-trip-needed { color: #d97706; }

/* Day events popup — keep centered (profileModalIn clears translate(-50%,-50%) and shifts it bottom-right) */
.cal-day-events-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px));
  max-height: min(85vh, 680px);
  background: #fff;
  border-radius: 16px;
  z-index: 95;
  box-shadow: 0 24px 48px rgba(15,23,42,.2);
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: calDayEventsIn .2s ease-out;
}
@keyframes calDayEventsIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.cal-day-events-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 24px 24px 16px; flex-shrink: 0;
}
.cal-day-events-head h3 { margin: 0; font-size: 20px; font-weight: 800; color: #111827; }
.cal-day-events-head p { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: #6b7280; }
.cal-day-events-body {
  flex: 1; overflow-y: auto; padding: 8px 24px 16px;
  display: flex; flex-direction: column; gap: 10px; min-height: 100px; max-height: 420px;
}
.cal-day-events-foot {
  flex-shrink: 0; padding: 16px 24px 24px; border-top: 1px solid #f3f4f6;
}
.cal-day-events-foot .wo-btn-primary {
  width: 100%; border-radius: 10px; padding: 14px; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Work order view panel */
.wo-view-shell {
  position: fixed; inset: 0; z-index: 95; pointer-events: none;
}
.wo-view-shell:not(.hidden) { pointer-events: auto; }
.wo-view-stage {
  position: fixed;
  top: 50%;
  left: 16px;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  align-items: stretch;
  max-height: min(92vh, 820px);
  z-index: 96;
  pointer-events: none;
}
.wo-view-shell:not(.hidden) .wo-view-stage { pointer-events: auto; }
.wo-view-shell .wo-view-modal.hidden,
.wo-view-shell .wo-comments-panel.hidden { display: none; }
.wo-view-shell:not(.hidden) .wo-view-modal:not(.hidden),
.wo-view-shell:not(.hidden) .wo-comments-panel:not(.hidden) { display: flex; }
.wo-view-modal {
  position: relative; left: auto; top: auto; transform: none;
  width: min(1040px, 58vw); max-height: min(92vh, 860px);
  background: #fff; border-radius: 24px 0 0 24px;
  box-shadow: 0 24px 48px rgba(15,23,42,.22); border: 1px solid #e5e7eb;
  border-right: none;
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 1; flex-shrink: 0;
}
.wo-view-shell #woViewOverlay {
  position: fixed; inset: 0; z-index: 95;
}
#woViewOverlay { backdrop-filter: none; }
#woViewOverlay.view-overlay-enter { animation: woViewOverlayIn .14s ease-out forwards; }
#woViewOverlay.view-overlay-leave { animation: woViewOverlayOut .12s ease-in forwards; }
#woViewModal.view-modal-enter { animation: woViewModalIn .18s cubic-bezier(.2,.85,.25,1) forwards; }
#woViewModal.view-modal-leave { animation: woViewModalOut .12s ease-in forwards; }
@keyframes woViewOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes woViewOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes woViewModalIn {
  from { transform: translateY(10px) scale(.985); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes woViewModalOut {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to { transform: translateY(8px) scale(.99); opacity: 0; }
}
.wo-view-color-bar { height: 8px; flex-shrink: 0; background: #3b82f6; }
.wo-view-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid #f3f4f6; flex-shrink: 0;
}
.wo-view-kicker {
  margin: 0 0 4px; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: #2563eb;
}
.wo-view-head h2 {
  margin: 0; font-size: clamp(20px, 3vw, 26px); font-weight: 800; color: #111827;
  line-height: 1.25; word-break: break-word;
}
.wo-view-date { margin: 6px 0 0; font-size: 15px; font-weight: 500; color: #6b7280; }
.wo-view-recurrence {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  font-size: 13px; font-weight: 700; color: #2563eb;
}
.wo-view-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.wo-view-status-select.wo-search-select {
  min-width: 220px;
  max-width: min(320px, 70vw);
}
.wo-view-status-select .wo-ss-trigger {
  min-height: 36px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  justify-content: space-between;
  padding: 6px 12px;
  color: #fff;
  border-color: transparent;
}
.wo-view-status-select .wo-ss-trigger::after {
  border-top-color: currentColor;
  opacity: 0.9;
}
.wo-overview-proposal {
  min-height: 88px;
}
.wo-overview-proposal-loading {
  display: grid;
  place-items: center;
  min-height: 88px;
  color: #64748b;
  font-size: 13px;
}
.wo-overview-proposal-card {
  display: grid;
  gap: 12px;
}
.wo-overview-proposal-card.is-empty {
  text-align: left;
}
.wo-overview-proposal-head {
  display: grid;
  gap: 6px;
}
.wo-overview-proposal-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.wo-overview-proposal-pill.is-ready {
  background: #ecfdf5;
  color: #047857;
}
.wo-overview-proposal-pill.is-missing {
  background: #fff7ed;
  color: #c2410c;
}
.wo-overview-proposal-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
}
.wo-overview-proposal-copy {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.wo-overview-proposal-meta {
  display: grid;
  gap: 8px;
}
.wo-overview-proposal-meta > div {
  display: grid;
  gap: 2px;
}
.wo-overview-proposal-meta span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}
.wo-overview-proposal-meta strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.wo-overview-proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body.wo-embed-edit {
  background: #eef2f7;
}
body.wo-embed-edit .topnav,
body.wo-embed-edit .topnav-backdrop {
  display: none !important;
}
body.wo-embed-edit .calendar-page > *:not(.drawer-overlay):not(.wo-drawer-stage) {
  display: none !important;
}
body.wo-embed-edit .drawer-overlay {
  display: block !important;
  background: #e8eef7;
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: none;
}
body.wo-embed-edit .wo-drawer-stage {
  display: flex !important;
  left: 0;
  right: 0;
  justify-content: center;
  z-index: 80;
}
body.wo-embed-edit .workorder-drawer {
  width: min(1080px, 100vw);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  border-radius: 0;
}
.calendar-page.wo-edit-host[hidden] {
  display: none !important;
}
.wo-view-action-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wo-view-status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; border: 1px solid transparent;
  background: #f59e0b; color: #fff; border-color: #f59e0b;
}
.wo-view-status-badge.Pending,
.wo-view-status-badge.status-pending { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.wo-view-status-badge.status-open { background: #f97316; color: #fff; border-color: #f97316; }
.wo-view-status-badge.status-need-vendor { background: #ea580c; color: #fff; border-color: #ea580c; }
.wo-view-status-badge.status-scheduling-with-vendor,
.wo-view-status-badge.status-assigned-to-vendor { background: #0284c7; color: #fff; border-color: #0284c7; }
.wo-view-status-badge.status-proposal-needed,
.wo-view-status-badge.status-need-proposal { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.wo-view-status-badge.status-need-proposal-for-repairs { background: #6d28d9; color: #fff; border-color: #6d28d9; }
.wo-view-status-badge.status-proposal-sent { background: #c026d3; color: #fff; border-color: #c026d3; }
.wo-view-status-badge.status-waiting-for-approval { background: #ca8a04; color: #fff; border-color: #ca8a04; }
.wo-view-status-badge.status-proposal-not-approved { background: #dc2626; color: #fff; border-color: #dc2626; }
.wo-view-status-badge.status-proposal-approved { background: #0d9488; color: #fff; border-color: #0d9488; }
.wo-view-status-badge.status-approved-needs-scheduling,
.wo-view-status-badge.status-approved-need-to-scheduled,
.wo-view-status-badge.status-need-to-schedule { background: #059669; color: #fff; border-color: #059669; }
.wo-view-status-badge.status-need-to-reschedule { background: #0891b2; color: #fff; border-color: #0891b2; }
.wo-view-status-badge.status-rescheduled { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.wo-view-status-badge.status-hold { background: #78716c; color: #fff; border-color: #78716c; }
.wo-view-status-badge.status-job-is-done-waiting-for-report { background: #14b8a6; color: #fff; border-color: #14b8a6; }
.wo-view-status-badge.Active,
.wo-view-status-badge.status-active,
.wo-view-status-badge.status-scheduled { background: #2563eb; color: #fff; border-color: #2563eb; }
.wo-view-status-badge.status-approved-waiting-for-parts,
.wo-view-status-badge.status-parts-needed { background: #e11d48; color: #fff; border-color: #e11d48; }
.wo-view-status-badge.Processing,
.wo-view-status-badge.status-processing,
.wo-view-status-badge.status-in-progress { background: #9333ea; color: #fff; border-color: #9333ea; }
.wo-view-status-badge.status-completed-invoice-needed,
.wo-view-status-badge.status-work-completed-need-to-invoice { background: #a16207; color: #fff; border-color: #a16207; }
.wo-view-status-badge.status-completed-need-invoice { background: #d97706; color: #fff; border-color: #d97706; }
.wo-view-status-badge.status-completed-bill-for-incurred-costs { background: #b45309; color: #fff; border-color: #b45309; }
.wo-view-status-badge.status-completed-vendor-payment-needed { background: #be185d; color: #fff; border-color: #be185d; }
.wo-view-status-badge.status-completed-vendor-paid,
.wo-view-status-badge.status-invoiced { background: #65a30d; color: #fff; border-color: #65a30d; }
.wo-view-status-badge.status-billed { background: #4d7c0f; color: #fff; border-color: #4d7c0f; }
.wo-view-status-badge.Completed,
.wo-view-status-badge.status-completed,
.wo-view-status-badge.status-complete { background: #15803d; color: #fff; border-color: #15803d; }
.wo-view-status-badge.status-canceled,
.wo-view-status-badge.status-cancelled { background: #64748b; color: #fff; border-color: #64748b; }
.wo-view-status-badge.status-return-trip-needed { background: #d97706; color: #fff; border-color: #d97706; }
.wo-view-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid #bfdbfe;
  background: #fff; color: #2563eb; cursor: pointer; transition: background .15s;
}
.wo-view-icon-btn svg { width: 18px; height: 18px; }
.wo-view-icon-btn:hover { background: #eff6ff; }
.wo-view-icon-btn.danger { border-color: #fecaca; color: #dc2626; }
.wo-view-icon-btn.danger:hover { background: #fef2f2; }
.wo-view-icon-btn.muted { border-color: #e5e7eb; color: #6b7280; }
.wo-view-icon-btn.muted:hover { background: #f3f4f6; }
.wo-print-choice-overlay { z-index: 1200; }
.wo-print-choice-popup {
  z-index: 1201;
  width: min(440px, calc(100vw - 32px));
  max-width: 440px;
}
.wo-print-choice-body {
  display: grid;
  gap: 12px;
  padding: 8px 22px 22px;
}
.wo-print-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid #dbe3f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.wo-print-choice-btn strong {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.wo-print-choice-btn span {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.4;
}
.wo-print-choice-btn:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}
.wo-print-options-overlay { z-index: 1202; }
.wo-print-options-popup {
  z-index: 1203;
  width: min(760px, calc(100vw - 28px));
  max-height: min(90vh, 900px);
}
.wo-print-options-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 8px;
  padding: 12px 22px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}
.wo-print-options-count {
  margin: 0 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}
.wo-print-options-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px 22px;
  background: #f8fafc;
}
.wo-print-option-section {
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: visible;
}
.wo-print-option-section.is-empty {
  background: #f8fafc;
}
.wo-print-option-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #eef2f7;
  box-sizing: border-box;
}
.wo-print-option-section.is-empty .wo-print-option-head {
  border-bottom: 0;
}
.wo-print-option-head-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
  line-height: 1.3;
}
.wo-print-option-head-check span {
  min-width: 0;
}
.wo-print-option-head-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
}
.wo-print-option-available,
.wo-print-option-empty {
  margin: 0;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  white-space: nowrap;
}
.wo-print-option-available {
  color: #2563eb;
}
.wo-print-option-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  padding: 14px 16px 16px;
  background: #fff;
}
.wo-print-option-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  min-width: 0;
  min-height: 22px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: #334155;
  cursor: pointer;
  box-sizing: border-box;
}
.wo-print-option-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  cursor: pointer;
  accent-color: #2563eb;
}
.wo-print-option-field.is-disabled {
  color: #94a3b8;
  cursor: not-allowed;
}
.wo-print-option-field-label {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.wo-print-option-field-hint {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}
@media (max-width: 640px) {
  .wo-print-option-fields { grid-template-columns: minmax(0, 1fr); }
  .wo-print-options-count {
    width: 100%;
    margin: 4px 0 0;
  }
}
.wo-print-logo-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.wo-view-body {
  flex: 1; overflow-y: auto; padding: 24px; min-height: 120px;
}
.wo-show-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
  padding-bottom: 0;
  overflow: hidden;
}
.wo-show-page-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #fff;
  backdrop-filter: none;
  border-radius: 0;
}
.wo-show-page.is-loading > :not(.wo-show-page-loader) {
  visibility: hidden;
  pointer-events: none;
}
.wo-show-page:not(.is-loading) > .wo-show-page-loader {
  display: none;
}
.wo-show-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100%;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}
.wo-show-sidebar-hero {
  height: 88px;
  background: linear-gradient(135deg, #cbd5e1 0%, #e2e8f0 55%, #f8fafc 100%);
}
.wo-show-sidebar-body {
  padding: 0 18px 20px;
  margin-top: -36px;
}
.wo-show-side-brand {
  text-align: center;
  margin-bottom: 18px;
}
.wo-show-side-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  border: 4px solid #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}
.wo-show-side-code {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.wo-show-side-address {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}
.wo-show-side-block {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  margin-top: 10px;
}
.wo-show-side-block-btn {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.wo-show-side-block-btn:hover,
.wo-show-side-block-btn:focus-visible {
  border-color: #bfdbfe;
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  outline: none;
}
.wo-show-side-block-empty .wo-show-side-empty {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: #94a3b8;
}
.wo-show-side-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.wo-show-side-value {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.wo-show-side-muted {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}
.wo-site-managers-popup {
  z-index: 121;
  width: min(520px, calc(100vw - 24px));
  max-width: min(520px, calc(100vw - 24px));
}
.wo-site-managers-list {
  display: grid;
  gap: 12px;
}
.wo-site-manager-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #eef2f7;
  background: #f8fafc;
}
.wo-site-manager-name {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.wo-site-manager-meta {
  display: grid;
  gap: 8px;
}
.wo-site-manager-meta div {
  display: grid;
  gap: 2px;
}
.wo-site-manager-meta span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.wo-site-manager-meta strong {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  word-break: break-word;
}
.wo-show-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.wo-show-main {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  min-height: 0;
}
.wo-show-comments-slot.hidden {
  display: none;
}
.wo-show-page .wo-comments-panel--view {
  position: relative;
  inset: auto;
  width: auto;
  max-height: none;
  height: auto;
  border-radius: 14px;
  box-shadow: none;
  border: 1px solid #e5e7eb;
  display: flex;
}
.wo-show-page .wo-comments-panel.hidden {
  display: flex;
}
.wo-show-meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
  width: 100%;
  padding: 14px 16px 34px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  position: relative;
  font: inherit;
  color: inherit;
}
.wo-show-meta-strip:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.wo-show-meta-strip > div {
  min-width: 0;
}
.wo-show-meta-strip span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 4px;
}
.wo-show-meta-strip strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}
.wo-show-meta-hint {
  position: absolute;
  right: 14px;
  bottom: 10px;
  margin: 0 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  color: #2563eb !important;
}
.wo-show-overview-comments {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wo-show-overview-comments .wo-comment-card {
  pointer-events: none;
}
.wo-show-overview-comments.is-empty .wo-view-empty-hint {
  margin-bottom: 0;
}
.wo-show-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.wo-show-overview-main,
.wo-show-overview-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.wo-show-widget {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}
.wo-show-proposal-panel {
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}
.wo-proposal-summary {
  min-height: 180px;
}
.wo-proposal-summary-loading {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}
.wo-proposal-summary > .wo-proposal-summary-card {
  position: relative;
  margin-top: 0;
  border: 1px solid #dbe3f0;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #f8fbff 0%, #ffffff 42%),
    #fff;
  padding: 22px 22px 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}
.wo-proposal-summary > .wo-proposal-summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #2563eb, #0ea5e9);
}
.wo-proposal-summary > .wo-proposal-summary-card.is-empty {
  text-align: center;
  padding: 36px 28px;
}
.wo-proposal-summary > .wo-proposal-summary-card.is-empty::before {
  display: none;
}
.wo-proposal-summary-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  flex-shrink: 0;
}
.wo-proposal-summary-icon.is-inline {
  margin: 0;
}
.wo-proposal-summary-icon svg {
  width: 28px;
  height: 28px;
}
.wo-proposal-summary-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.wo-proposal-summary-top-text {
  min-width: 0;
  flex: 1;
}
.wo-proposal-summary-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wo-proposal-summary-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.wo-proposal-summary-copy {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}
.wo-proposal-summary-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 18px 0 20px;
}
.wo-proposal-summary-meta-item {
  border: 1px solid #e8eef7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
}
.wo-proposal-summary-meta-item span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}
.wo-proposal-summary-meta-item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}
.wo-proposal-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.wo-proposal-summary-actions.is-centered {
  justify-content: center;
  margin-top: 18px;
}
.wo-proposal-summary-actions .btn {
  min-height: 40px;
}
@media (max-width: 640px) {
  .wo-proposal-summary-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .wo-proposal-summary-actions {
    justify-content: center;
  }
}
.wo-show-proposal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 16px;
}
.wo-show-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.wo-show-widget-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.wo-show-widget-meta {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.wo-show-kv {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wo-show-kv > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.wo-show-kv span {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
}
.wo-show-kv strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
}
.wo-show-asset-empty {
  padding: 18px 12px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  background: #f8fafc;
  border-radius: 12px;
}
.wo-show-comm-host .wo-comments-panel--view {
  margin-top: 4px;
}
.wo-details-popup-overlay {
  z-index: 120;
}
.wo-details-popup {
  z-index: 121;
  max-width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.wo-details-popup-body {
  padding: 0 28px 20px;
  overflow-y: auto;
  min-height: 120px;
}
.wo-details-popup-body .wo-show-widget {
  margin-top: 14px;
}
@media (max-width: 1100px) {
  .wo-show-page {
    grid-template-columns: 1fr;
  }
  .wo-show-sidebar {
    position: static;
  }
  .wo-show-overview {
    grid-template-columns: 1fr;
  }
  .wo-show-meta-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .wo-show-meta-strip {
    grid-template-columns: 1fr;
  }
}
.wo-view-loading {
  padding: 48px 16px;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}
.wo-lifecycle {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.wo-lifecycle-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}
.wo-lifecycle-banner span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.wo-lifecycle-banner p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.wo-lifecycle-stepper {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  overflow-x: auto;
}
.wo-lifecycle-step {
  position: relative;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.wo-lifecycle-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: #e2e8f0;
}
.wo-lifecycle-step.is-done:not(:last-child)::after {
  background: #34d399;
}
.wo-lifecycle-dot {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: #e2e8f0;
  color: #64748b;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1;
}
.wo-lifecycle-step.is-done .wo-lifecycle-dot {
  background: #10b981;
  color: #fff;
  box-shadow: 0 0 0 1px #059669;
}
.wo-lifecycle-step.is-next .wo-lifecycle-dot {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 1px #1d4ed8;
}
.wo-lifecycle-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wo-lifecycle-copy strong {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.wo-lifecycle-copy span {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
}
.wo-view-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0;
}
.wo-view-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 10px 2px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  cursor: pointer;
}
.wo-view-tab.is-active {
  color: #0f172a;
}
.wo-view-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: #2563eb;
}
.wo-view-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
.wo-view-tab-panel {
  display: none;
}
.wo-view-tab-panel.is-active {
  display: block;
}
.wo-view-empty-hint {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.wo-view-comm-card,
.wo-view-gallery {
  margin-top: 4px;
}
.wo-show-attachments-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.wo-show-attach-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 16px 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}
.wo-show-attach-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.wo-show-attach-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  flex-shrink: 0;
}
.wo-show-attach-card-icon svg {
  width: 20px;
  height: 20px;
}
.wo-show-attach-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.wo-show-attach-card-meta {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.wo-show-attach-dropzone {
  margin-top: 14px;
}
.wo-show-attach-dropzone.is-dragover {
  border-color: #2563eb;
  background: #eff6ff;
}
.wo-show-attach-upload {
  margin-top: 12px;
  display: inline-flex;
}
.wo-show-attach-upload.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.wo-show-attach-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wo-show-attach-file-row {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding-right: 8px;
}
.wo-show-attach-remove {
  margin-left: 4px;
}
.wo-show-attach-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wo-show-attach-divider::before,
.wo-show-attach-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.wo-view-image-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.wo-view-image-remove {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.wo-view-image-remove:hover {
  background: #dc2626;
}
.wo-view-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wo-view-image-stamp {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.78) 40%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .wo-lifecycle-stepper {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }
}
@media (max-width: 720px) {
  .wo-lifecycle-stepper {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  .wo-lifecycle-step:not(:last-child)::after {
    display: none;
  }
}
.wo-view-grid {
  display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 12px;
}
@media (min-width: 640px) { .wo-view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .wo-view-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wo-view-card.span-2 { grid-column: span 1; }
@media (min-width: 640px) { .wo-view-card.span-2 { grid-column: span 2; } }
.wo-view-card.span-full {
  grid-column: 1 / -1;
}
.wo-details-popup-body .wo-view-card.span-full .wo-view-card-value {
  white-space: pre-wrap;
  font-weight: 600;
  line-height: 1.55;
}
.wo-show-meta-strip-notes {
  grid-column: 1 / -1;
}
.wo-show-meta-strip-notes strong {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  line-height: 1.45;
}
.wo-view-card {
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px 16px;
  min-height: 72px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.wo-view-card-label {
  display: flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: #64748b;
}
.wo-view-card-label svg { width: 14px; height: 14px; stroke: #94a3b8; fill: none; stroke-width: 2; }
.wo-view-card-value { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; line-height: 1.45; word-break: break-word; }
.wo-view-priority {
  display: inline-flex; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
}
.wo-view-priority.None { background: #f3f4f6; color: #4b5563; }
.wo-view-priority.Low { background: #eff6ff; color: #1d4ed8; }
.wo-view-priority.Medium { background: #fff7ed; color: #c2410c; }
.wo-view-priority.High { background: #fef2f2; color: #b91c1c; }
.wo-view-priority.S1 { background: #fef2f2; color: #b91c1c; }
.wo-view-priority.S2 { background: #fef2f2; color: #b91c1c; }
.wo-view-priority.S1\|S2 { background: #fef2f2; color: #b91c1c; }
.wo-view-priority.S3 { background: #fff7ed; color: #c2410c; }
.wo-view-priority.S4\|S5 { background: #eff6ff; color: #1d4ed8; }
.wo-view-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.wo-view-cat {
  padding: 4px 10px; border-radius: 999px; background: #eff6ff; color: #1e40af;
  font-size: 12px; font-weight: 700; border: 1px solid #dbeafe;
}
.wo-view-section { margin-top: 16px; }
.wo-view-section-title {
  margin: 0 0 10px; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: #9ca3af;
}
.wo-view-list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #f3f4f6; border-radius: 12px; background: #fff; margin-bottom: 8px;
}
.wo-view-list-item svg { width: 18px; height: 18px; stroke: #3b82f6; fill: none; stroke-width: 2; flex-shrink: 0; }
.wo-view-list-item p { margin: 0; font-size: 14px; font-weight: 600; color: #111827; flex: 1; min-width: 0; }
.wo-view-list-item small { display: block; font-size: 12px; color: #6b7280; font-weight: 500; }
.wo-view-file-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}
.wo-view-file-actions .wo-view-download {
  position: static;
}
.wo-view-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.wo-view-image-thumb {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
    aspect-ratio: 1;
}
.wo-view-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wo-view-image-thumb img.is-broken {
    object-fit: contain;
    padding: 12px;
    opacity: 0.45;
}
.wo-view-image-thumb .wo-view-download {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.wo-view-download {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: #eff6ff;
  color: #2563eb; cursor: pointer; flex-shrink: 0;
}
.wo-view-download svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.wo-view-color-preview {
  display: flex; align-items: center; gap: 12px;
}
.wo-view-color-swatch {
  width: 40px; height: 40px; border-radius: 999px; border: 2px solid #e5e7eb; box-shadow: 0 1px 3px rgba(15,23,42,.1);
}
.wo-view-foot {
  flex-shrink: 0; padding: 16px 24px 24px; border-top: 1px solid #f3f4f6;
  display: flex; gap: 12px; align-items: center;
}
.wo-view-comments-btn { flex: 1; }
.wo-view-close-full {
  flex: 1;
  width: auto; padding: 14px; border: 0; border-radius: 12px; background: #f3f4f6;
  color: #111827; font-size: 15px; font-weight: 800; cursor: pointer; transition: background .15s;
}
.wo-view-close-full:hover { background: #e5e7eb; }
.wo-cancel-btn {
  flex: 1; padding: 14px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; color: #374151; font-size: 15px; font-weight: 700; cursor: pointer;
}
.wo-drawer-footer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.wo-drawer-footer-actions .wo-submit-btn {
  flex: 1;
  width: auto;
}
.wo-drawer-comments-btn {
  flex-shrink: 0;
  min-width: 132px;
}

.cal-grid-loading {
  grid-column: 1 / -1; padding: 48px 24px; text-align: center; color: #9ca3af; font-weight: 700;
}

/* Tracking */
.tracking-title { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 800; color: #111827; letter-spacing: -0.02em; }
.tracking-layout {
  display: flex; flex-direction: column; gap: 16px;
  flex: 1 1 0; min-height: 0; height: 0;
  align-items: stretch; overflow: hidden;
}
@media (min-width: 768px) {
  .tracking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    flex-direction: unset;
    gap: 16px;
  }
}
.tracking-map-panel {
  position: relative; min-height: 0; min-width: 0;
  border-radius: 16px; border: 1px solid #e5e7eb; background: #fff;
  overflow: hidden; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.tracking-map-canvas { position: absolute; inset: 0; }
.tracking-map-inner { width: 100%; height: 100%; }
.tracking-map-canvas iframe { width: 100%; height: 100%; border: 0; display: block; }
.tracking-map-pulse {
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.tracking-map-pulse-ring,
.tracking-map-pulse-core {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.tracking-map-pulse-core {
  width: 10px;
  height: 10px;
  background: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}
.tracking-map-pulse-ring {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 99, 235, 0.45);
  opacity: 0;
  animation: tracking-map-pulse-ring 2.4s cubic-bezier(0.15, 0.7, 0.25, 1) infinite;
}
.tracking-map-pulse-ring:nth-child(2) {
  animation-delay: 1.1s;
}
.tracking-map-pulse.is-emphasized .tracking-map-pulse-core {
  width: 12px;
  height: 12px;
  background: rgba(37, 99, 235, 0.78);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}
.tracking-map-pulse.is-emphasized .tracking-map-pulse-ring {
  border-color: rgba(37, 99, 235, 0.55);
  animation-duration: 2s;
}
@keyframes tracking-map-pulse-ring {
  0% {
    width: 12px;
    height: 12px;
    opacity: 0.55;
  }
  70% {
    opacity: 0.18;
  }
  100% {
    width: 56px;
    height: 56px;
    opacity: 0;
  }
}
.live-badge {
  position: absolute; top: 16px; right: 16px; z-index: 2; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #f3f4f6; border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 800; color: #374151; box-shadow: 0 4px 12px rgba(15,23,42,.08);
}
.live-badge.is-socket-live {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: #22c55e; }
.tracking-employees-panel {
  min-height: 0; min-width: 0; max-height: 100%;
  display: flex; flex-direction: column;
  border-radius: 16px; border: 1px solid #e5e7eb; background: #fff;
  padding: 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden;
}
.tracking-employees-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; flex-shrink: 0; }
.tracking-employees-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: #111827; }
.tracking-employees-head .btn { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-icon-svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.tracking-muted { margin: 0 0 10px; font-size: 14px; font-weight: 500; color: #9ca3af; flex-shrink: 0; }
.tracking-employees-body {
  flex: 1 1 0; min-height: 0; height: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: block; padding-right: 4px;
  scrollbar-gutter: stable;
  position: relative;
}
.tracking-technicians-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(3px);
  border-radius: 12px;
}
.tracking-technicians-loader.hidden { display: none; }
.tracking-employees-body::-webkit-scrollbar { width: 6px; }
.tracking-employees-body::-webkit-scrollbar-thumb {
  background: #d1d5db; border-radius: 999px;
}
.tracking-employees-body::-webkit-scrollbar-track { background: transparent; }
.tracking-employees-list { display: flex; flex-direction: column; gap: 10px; }
.tracking-employee-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #f3f4f6; border-radius: 12px; background: #fafafa; flex-shrink: 0;
  cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.tracking-employee-card:hover {
  border-color: #dbeafe; background: #fff;
}
.tracking-employee-card.is-tracking {
  border-color: #2563eb; background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37,99,235,.12);
}
.tracking-employee-copy { flex: 1; min-width: 0; }
.tracking-employee-actions {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0;
}
.tracking-view-btn {
  min-height: 32px; padding: 0 12px; font-size: 12px; font-weight: 700;
}
.tracking-employee-name { margin: 0; font-size: 14px; font-weight: 700; color: #111827; }
.tracking-employee-meta { margin: 2px 0 0; font-size: 12px; color: #6b7280; font-weight: 500; }
.tracking-online-dot {
  width: 10px; height: 10px; border-radius: 999px; background: #22c55e; margin-left: auto; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
}
.tracking-empty {
  flex: 1; display: grid; place-items: center; border-radius: 12px; border: 1px solid #f3f4f6;
  background: rgba(249,250,251,.5); color: #9ca3af; font-weight: 800; font-size: 16px; min-height: 120px;
}
.tracking-empty.hidden { display: none; }

.tracking-wo-modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; pointer-events: none;
}
.tracking-wo-modal:not(.hidden) { pointer-events: auto; }
.tracking-wo-modal.hidden { display: none; }
.tracking-wo-modal-card {
  width: min(560px, 100%); max-height: min(82vh, 760px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 24px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,42,.18);
  border: 1px solid #e5e7eb;
}
.tracking-wo-modal-head {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 22px 22px 16px; border-bottom: 1px solid #f3f4f6;
}
.tracking-wo-kicker {
  margin: 0 0 4px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em; color: #64748b;
}
.tracking-wo-modal-head h2 {
  margin: 0; font-size: 22px; font-weight: 800; color: #0f172a; letter-spacing: -.02em;
}
.tracking-wo-subtitle { margin: 6px 0 0; font-size: 14px; color: #64748b; font-weight: 500; }
.tracking-wo-close {
  flex-shrink: 0; align-self: flex-start;
}
.tracking-wo-modal-body {
  padding: 18px 22px; overflow-y: auto;
}
.tracking-wo-summary-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.tracking-wo-summary-card {
  padding: 14px 16px; border: 1px solid #eef2f7; border-radius: 16px; background: #f8fafc;
}
.tracking-wo-summary-card span {
  display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; color: #64748b;
}
.tracking-wo-summary-card strong {
  display: block; font-size: 14px; font-weight: 700; color: #0f172a; line-height: 1.45;
}
.tracking-wo-status {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; text-transform: uppercase;
}
.tracking-wo-status.Active { background: #eff6ff; color: #2563eb; }
.tracking-wo-status.Pending { background: #fefce8; color: #ca8a04; }
.tracking-wo-status.Processing { background: #f5f3ff; color: #7c3aed; }
.tracking-wo-status.Completed { background: #ecfdf5; color: #059669; }
.tracking-wo-description {
  margin-top: 16px; padding: 16px; border: 1px solid #eef2f7; border-radius: 16px; background: #fff;
}
.tracking-wo-description h3 {
  margin: 0 0 8px; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: #64748b;
}
.tracking-wo-description p {
  margin: 0; font-size: 14px; line-height: 1.55; color: #334155; white-space: pre-wrap;
}
.tracking-wo-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; min-height: 180px; color: #64748b; font-weight: 700;
}
.tracking-wo-modal-foot {
  padding: 14px 22px 20px; border-top: 1px solid #f3f4f6; display: flex; justify-content: flex-end;
}

@media (max-width: 767px) {
  body[data-page="tracking"] .app-main { padding-bottom: 12px; }
  body[data-page="tracking"] .tracking-page { gap: 12px; }
  .tracking-layout {
    gap: 12px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
  .tracking-map-panel { min-height: 0; }
  .tracking-employees-panel { min-height: 0; }
  .tracking-wo-summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wo-drawer-body { padding: 16px 20px; }
  .wo-drawer-footer { padding: 12px 20px; }
  .wo-grid-2 { grid-template-columns: 1fr; }
  .wo-section { padding: 14px; }
  .wo-submitted-time-row { max-width: none; }
  .entity-grid-2,
  .entity-grid-3 { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; }
  .wo-sub-hint { width: 100%; }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%);
    transition: transform .25s ease; width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .app-main { padding-top: 64px; padding-left: 64px; }
}

@media (min-width: 1024px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; height: 100vh;
    transition: transform .3s ease;
  }
  .app-main {
    margin-left: 256px; width: calc(100% - 256px);
    padding-left: 24px;
    transition: margin-left .3s ease, width .3s ease, padding-left .3s ease;
  }
  .app-shell.sidebar-collapsed .app-main {
    margin-left: 0; width: 100%;
    padding-left: 64px;
  }
  .sidebar.collapsed { transform: translateX(-100%); }
  .sidebar-open-btn.desktop-show {
    display: inline-flex !important; align-items: center; justify-content: center;
  }
}

/* Login — reserve space for Google button before GSI renders */
.login-page .google-signin-slot {
  min-height: 56px;
  min-width: 100%;
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-page .google-btn-inner {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
}
.login-page .google-btn-inner iframe,
.login-page .login-google-btn-hitbox iframe,
.login-page .login-google-btn-hitbox div[role="button"] {
  width: 100% !important;
  height: 56px !important;
  max-width: none !important;
}
.login-page .auth-processing {
  width: 100%;
  max-width: 360px;
  min-width: 0;
  min-height: 56px;
  justify-content: center;
  font-weight: 700;
}
@media (max-width: 1024px) {
  .login-split {
    grid-template-columns: 1fr;
  }
  .login-hero {
    min-height: 40vh;
    padding: 36px 28px;
  }
  .login-hero-chip {
    display: none;
  }
  .login-panel-inner {
    max-width: 560px;
  }
  .login-panel {
    padding: 32px 24px 42px;
  }
}
@media (max-width: 480px) {
  .login-hero {
    padding: 28px 20px;
  }
  .login-hero-title {
    font-size: 38px;
  }
  .login-hero-copy {
    font-size: 14px;
  }
  .login-panel {
    padding: 26px 16px 32px;
  }
  .login-panel-inner {
    padding: 28px 22px;
    border-radius: 22px;
  }
  .login-panel-brand {
    max-width: 320px;
    margin-bottom: 18px;
  }
  .login-panel-brand img {
    max-height: 88px;
  }
  .login-panel-title {
    font-size: 26px;
  }
}
/* ——— Powered-by branding below sign-in card ——— */
.login-powered-by {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin: 0;
  width: 100%;
  max-width: 420px;
  padding: 0 8px;
  text-align: center;
}

.login-powered-by-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #1e293b;
  line-height: 1.2;
}

.login-powered-by-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.login-powered-by-brand:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.login-powered-by-brand:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
}

.login-powered-by-logo {
  display: block;
  width: auto;
  height: 36px;
  max-width: min(100%, 168px);
  object-fit: contain;
}

/* Legacy alias kept for any leftover markup */
.BlueStone-sign-below {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  margin: 0;
  max-width: 28rem;
  width: 100%;
  padding: 0 0.5rem;
  flex-wrap: wrap;
}

.BlueStone-sign-below-text {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #1e293b;
  opacity: 0.88;
}

.BlueStone-sign-below-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  text-decoration: none;
  border-radius: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.BlueStone-sign-below-brand:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  opacity: 0.95;
}

.BlueStone-sign-below-brand:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
}

.BlueStone-sign-below-logo {
  display: block;
  height: auto;
  width: min(100%, 9.25rem);
  max-height: 2.2rem;
  object-fit: contain;
  border-radius: 10px;
}

.BlueStone-sign-below a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.BlueStone-sign-below a:hover {
  text-decoration: none;
}

.BlueStone-sign-below-muted {
  color: #64748b;
  font-weight: 400;
}
/* Calendar page — fill viewport; scroll inside cards/panels */
body[data-page="calendar"] .app-main,
body[data-page="preventive-wo"] .app-main,
body[data-page="reactive-wo"] .app-main {
  display: flex; flex-direction: column; overflow: hidden;
}
body[data-page="calendar"] .calendar-page,
body[data-page="preventive-wo"] .calendar-page,
body[data-page="reactive-wo"] .calendar-page {
  flex: 1; min-height: 0; gap: 16px; padding-bottom: 0; overflow: hidden;
}
body[data-page="preventive-wo"] .calendar-page--list,
body[data-page="reactive-wo"] .calendar-page--list {
  overflow: hidden;
}
body[data-page="preventive-wo"] .calendar-page--list .wo-list-panel,
body[data-page="reactive-wo"] .calendar-page--list .wo-list-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body[data-page="preventive-wo"] .calendar-page--list .wo-list-hero,
body[data-page="reactive-wo"] .calendar-page--list .wo-list-hero {
  flex-shrink: 0;
}
body[data-page="calendar"] .calendar-toolbar-card,
body[data-page="preventive-wo"] .calendar-toolbar-card,
body[data-page="reactive-wo"] .calendar-toolbar-card { flex-shrink: 0; margin-bottom: 0; }
body[data-page="calendar"] .calendar-grid-card,
body[data-page="preventive-wo"] .calendar-grid-card,
body[data-page="reactive-wo"] .calendar-grid-card {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  overflow: hidden;
}
body[data-page="calendar"] #calendarGrid,
body[data-page="preventive-wo"] #calendarGrid,
body[data-page="reactive-wo"] #calendarGrid {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
body[data-page="calendar"] .gcal-month-grid,
body[data-page="preventive-wo"] .gcal-month-grid,
body[data-page="reactive-wo"] .gcal-month-grid {
  min-height: 100%;
}

.wo-static-value {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

/* Google Calendar–style grid */
.gcal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #dadce0;
  border-left: 1px solid #dadce0;
}
.gcal-month-head {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #70757a;
  text-align: center;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  background: #fff;
}
.gcal-month-cell {
  min-height: 100px;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  padding: 4px 6px 6px;
  background: #fff;
  vertical-align: top;
  cursor: pointer;
  transition: background .12s;
  position: relative;
  overflow: hidden;
}
.gcal-month-cell:hover { background: #f8f9fa; }
.gcal-month-cell.gcal-other { background: #fafafa; }
.gcal-month-cell.gcal-other .gcal-date-num { color: #70757a; opacity: 0.65; }
.gcal-date-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 500;
  color: #3c4043;
  border-radius: 999px;
  margin-bottom: 2px;
}
.gcal-date-num.today {
  background: #1a73e8;
  color: #fff;
  font-weight: 600;
}
.gcal-month-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: calc(100% - 28px);
  min-height: 0;
  overflow: hidden;
}
.gcal-month-events-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
}
.gcal-month-event {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1px 2px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: #3c4043;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.gcal-month-event:hover { background: #f1f3f4; }
.gcal-month-timed { font-weight: 400; }
.gcal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.gcal-month-time {
  flex-shrink: 0;
  font-size: 10px;
  color: #70757a;
  font-weight: 500;
}
.gcal-month-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.gcal-month-allday {
  color: #fff;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 1px;
}
.gcal-more {
  font-size: 11px;
  font-weight: 500;
  color: #70757a;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 1px 4px 0;
  text-align: left;
  margin-top: auto;
  align-self: flex-start;
  border-radius: 4px;
}
.gcal-more:hover { color: #1a73e8; }

/* Week / Day time grid */
.gcal-time-grid-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.gcal-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.gcal-time-layout {
  display: grid;
  grid-template-columns: 56px repeat(var(--gcal-day-count, 7), minmax(0, 1fr));
  grid-template-rows: auto auto 1fr;
  min-width: 640px;
}
.gcal-corner {
  grid-column: 1;
  grid-row: 1;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  background: #fff;
  min-height: 56px;
}
.gcal-day-headers {
  grid-column: 2 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(var(--gcal-day-count, 7), minmax(0, 1fr));
  border-bottom: 1px solid #dadce0;
}
.gcal-day-head {
  padding: 8px 4px 10px;
  text-align: center;
  border-right: 1px solid #dadce0;
  background: #fff;
}
.gcal-day-head:last-child { border-right: none; }
.gcal-dow {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #70757a;
  text-transform: uppercase;
}
.gcal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 400;
  color: #3c4043;
  border-radius: 999px;
}
.gcal-day-num.today,
.gcal-day-head.today .gcal-day-num {
  background: #1a73e8;
  color: #fff;
}
.gcal-allday-label {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px;
  font-size: 10px;
  color: #70757a;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  background: #fff;
}
.gcal-allday-row {
  grid-column: 2 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(var(--gcal-day-count, 7), minmax(0, 1fr));
  border-bottom: 1px solid #dadce0;
  min-height: 28px;
}
.gcal-allday-col {
  border-right: 1px solid #dadce0;
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  min-height: 28px;
}
.gcal-allday-col:last-child { border-right: none; }
.gcal-allday-pill {
  border: 0;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gcal-time-axis {
  grid-column: 1;
  grid-row: 3;
  border-right: 1px solid #dadce0;
  background: #fff;
}
.gcal-time-label {
  position: relative;
  font-size: 10px;
  color: #70757a;
  box-sizing: border-box;
}
.gcal-time-label span {
  position: absolute;
  top: -6px;
  right: 8px;
  white-space: nowrap;
}
.gcal-days-grid {
  grid-column: 2 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(var(--gcal-day-count, 7), minmax(0, 1fr));
  position: relative;
}
.gcal-day-col {
  position: relative;
  border-right: 1px solid #dadce0;
  cursor: pointer;
  overflow: hidden;
}
.gcal-day-col:last-child { border-right: none; }
.gcal-hour-grid { position: absolute; inset: 0; pointer-events: none; }
.gcal-hour-row { border-bottom: 1px solid #dadce0; box-sizing: border-box; }
.gcal-events-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gcal-timed-event {
  position: absolute;
  border: 0;
  border-left: 4px solid;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.3;
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  pointer-events: auto;
  box-shadow: 0 1px 2px rgba(60,64,67,.15);
  z-index: 1;
}
.gcal-timed-event:hover { filter: brightness(1.05); z-index: 2; }
.gcal-event-title {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gcal-event-time {
  display: block;
  font-size: 10px;
  opacity: 0.92;
}
.gcal-day-view .gcal-time-layout { min-width: 480px; }
.gcal-week-view .gcal-scroll { max-height: calc(100vh - 220px); }
.gcal-day-view .gcal-scroll { max-height: calc(100vh - 220px); }
.cal-grid-loading {
  padding: 48px 24px;
  text-align: center;
  color: #70757a;
  font-size: 14px;
}

/* Reminiss-style draggable dashboard */
.dashboard-page,
.app-main > .dashboard-page {
  gap: 12px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.dash-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 0;
  flex-shrink: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.dash-topbar-title {
  margin: 0;
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}
.dash-topbar-title span {
  background: linear-gradient(90deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dash-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Digital wall-clock — larger frosted card with soft 3D depth */
.dash-clock {
  --dash-clock-accent: #ff7a18;
  --dash-clock-ink: #0f172a;
  display: grid;
  grid-template-columns: auto minmax(132px, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  min-width: 280px;
  padding: 12px 18px;
  border-radius: 18px;
  color: var(--dash-clock-ink);
  font-family: "Orbitron", "Segoe UI", sans-serif;
  background:
    linear-gradient(155deg, rgba(255,255,255,.95) 0%, rgba(248,250,252,.88) 45%, rgba(241,245,249,.82) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(15, 23, 42, 0.04) inset,
    0 10px 18px rgba(15, 23, 42, 0.06),
    0 22px 40px rgba(102, 126, 234, 0.14),
    0 2px 0 rgba(15, 23, 42, 0.03);
  transform: perspective(900px) rotateX(4deg) translateY(0);
  transform-style: preserve-3d;
  transition: transform .25s ease, box-shadow .25s ease;
}
.dash-clock:hover {
  transform: perspective(900px) rotateX(1deg) translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 -1px 0 rgba(15, 23, 42, 0.05) inset,
    0 14px 24px rgba(15, 23, 42, 0.08),
    0 28px 48px rgba(102, 126, 234, 0.18),
    0 3px 0 rgba(15, 23, 42, 0.04);
}
.dash-clock-days {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 2px 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  line-height: 1;
  transform: translateZ(12px);
}
.dash-clock-days span {
  padding: 2px 6px;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.dash-clock-days .is-active {
  color: #fff;
  background: linear-gradient(145deg, #ff9a4a 0%, #ff7a18 45%, #ef5a00 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 4px 10px rgba(255, 122, 24, 0.4);
  transform: translateZ(8px) scale(1.04);
}
.dash-clock-core {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  transform: translateZ(18px);
}
.dash-clock-face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 4px 0;
}
.dash-clock-meridiem {
  position: absolute;
  top: 0;
  left: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #64748b;
}
.dash-clock-time {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: clamp(28px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--dash-clock-ink);
  text-shadow: 0 2px 0 rgba(255,255,255,.8), 0 6px 14px rgba(15, 23, 42, 0.12);
}
.dash-clock-colon {
  display: inline-block;
  width: 0.32em;
  text-align: center;
  color: var(--dash-clock-accent);
  transition: opacity .2s ease;
  text-shadow: 0 2px 8px rgba(255, 122, 24, 0.35);
}
.dash-clock-colon.is-dim {
  opacity: .28;
}
.dash-clock-time-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.dash-clock-sec-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(102, 126, 234, .14);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.dash-clock-sec-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #667eea, #ff7a18);
  box-shadow: 0 0 10px rgba(255, 122, 24, 0.35);
  transition: width .9s linear;
}
.dash-clock-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 2px;
  min-width: 78px;
  padding: 2px 0 2px 14px;
  border-left: 1px solid rgba(102, 126, 234, .2);
  transform: translateZ(14px);
}
.dash-clock-month {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--dash-clock-accent);
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.dash-clock-day-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--dash-clock-accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(255,255,255,.55), 0 6px 12px rgba(255, 122, 24, 0.22);
}
.dash-clock-year {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #667eea;
}
@media (max-width: 640px) {
  .dash-topbar-actions {
    width: 100%;
    margin-left: 0;
  }
  .dash-clock {
    width: 100%;
    min-width: 0;
    transform: none;
  }
  .dash-clock:hover {
    transform: translateY(-2px);
  }
}
.dash-reset-btn {
  border: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.28);
  transition: filter .15s, transform .15s;
}
.dash-reset-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.dash-drag-hint {
  margin: 0;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
}

.dashboard-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-top: 0;
  padding-bottom: 12px;
}

.dash-widget {
  position: relative;
  min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.dash-widget.is-dragging {
  opacity: .72;
  transform: scale(.985);
  z-index: 20;
  box-shadow: 0 16px 40px rgba(102, 126, 234, 0.2);
}

.dash-span-3 { grid-column: span 12; }
.dash-span-4 { grid-column: span 12; }
.dash-span-6 { grid-column: span 12; }
.dash-span-8 { grid-column: span 12; }
.dash-span-12 { grid-column: span 12; }
@media (min-width: 640px) {
  .dash-span-3 { grid-column: span 6; }
  .dash-span-4 { grid-column: span 6; }
  .dash-span-8 { grid-column: span 12; }
  .dash-span-12 { grid-column: span 12; }
}
@media (min-width: 1024px) {
  .dash-span-3 { grid-column: span 3; }
  .dash-span-4 { grid-column: span 4; }
  .dash-span-6 { grid-column: span 6; }
  .dash-span-8 { grid-column: span 8; }
  .dash-span-12 { grid-column: span 12; }
}

.dash-widget-drag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.22);
  color: rgba(255,255,255,.95);
  display: grid;
  place-items: center;
  cursor: grab;
  padding: 0;
  transition: background .15s;
  touch-action: none;
  user-select: none;
}
.dash-panel .dash-widget-drag {
  position: static;
  background: #ede9fe;
  color: #7c3aed;
  flex-shrink: 0;
}
.dash-widget-drag:hover { background: rgba(255,255,255,.32); }
.dash-panel .dash-widget-drag:hover {
  background: #ddd6fe;
}
.dash-widget-drag:active { cursor: grabbing; }
.dash-widget-drag svg { width: 16px; height: 16px; }

.dash-kpi-card {
  position: relative;
  display: block;
  border-radius: 16px;
  padding: 22px 20px 18px;
  min-height: 148px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(15,23,42,.12);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15,23,42,.16);
  color: #fff;
}
a.dash-kpi-card:focus-visible {
  outline: 3px solid rgba(255,255,255,.7);
  outline-offset: 3px;
}
.dash-kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 58%);
  pointer-events: none;
}
.dash-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.22);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.dash-kpi-icon-svg { width: 20px; height: 20px; display: block; }
.dash-kpi-value {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.dash-kpi-label {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  opacity: .95;
}
.dash-kpi-trend {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 600;
  opacity: .82;
}
.dash-kpi-card.is-loading .dash-kpi-load-bar {
  display: block;
  width: 72px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,.22);
  animation: dash-kpi-pulse 1.3s ease-in-out infinite;
}
.dash-kpi-card.is-loading .dash-kpi-load-line {
  display: block;
  width: 128px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  animation: dash-kpi-pulse 1.3s ease-in-out infinite .15s;
}
.dash-kpi-value-ready,
.dash-kpi-trend-ready {
  animation: dash-kpi-fade-in .35s ease;
}
@keyframes dash-kpi-pulse {
  0%, 100% { opacity: .42; transform: scale(.98); }
  50% { opacity: .88; transform: scale(1); }
}
@keyframes dash-kpi-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-panel {
  height: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.dash-panel--flush .dash-panel-body {
  padding: 18px 18px 16px;
}
.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
}
.dash-panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}
.dash-panel-head p {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
.dash-panel-body {
  flex: 1;
  padding: 16px 20px 20px;
  min-height: 180px;
}
.dash-panel-loading {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: #9ca3af;
}

.dash-metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1.5px solid currentColor;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.dash-metric-pill.tone-preventive { color: #34c759; }
.dash-metric-pill.tone-low { color: #3b82f6; }
.dash-metric-pill.tone-reactive,
.dash-metric-pill.tone-none { color: #3478f6; }
.dash-metric-pill.tone-other { color: #93c5fd; }
.dash-metric-pill.tone-medium { color: #eab308; }
.dash-metric-pill.tone-high,
.dash-metric-pill.tone-severity { color: #ef4444; }

.dash-type-chart {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 260px;
  height: 100%;
}
.dash-type-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(110px, 0.9fr);
  gap: 12px;
  align-items: stretch;
}
.dash-type-summary--pair {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(120px, 0.95fr);
}
.dash-type-summary--periods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1.15fr)) minmax(120px, 0.85fr);
  gap: 12px;
  align-items: stretch;
}
.dash-month-block,
.dash-year-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.dash-month-block.is-current {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}
.dash-month-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.dash-month-block-head strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.dash-month-block-head span {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}
.dash-month-block-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dash-month-block-stats .dash-type-stat strong {
  font-size: clamp(18px, 1.8vw, 24px);
}
.dash-month-block-ratios {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-month-block-ratios .tone-preventive { color: #16a34a; }
.dash-month-block-ratios .tone-reactive { color: #2563eb; }
.dash-year-block .dash-type-ratio {
  border-left: 0;
  padding-left: 0;
  gap: 6px;
}
.dash-year-block .dash-type-ratio strong {
  font-size: 22px;
}
.dash-year-block .dash-type-ratio.tone-preventive strong {
  color: #16a34a;
}
.dash-year-block .dash-type-ratio.tone-reactive strong {
  color: #2563eb;
}
.dash-year-note {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.dash-year-note .tone-preventive {
  color: #16a34a;
}
.dash-year-note .tone-reactive {
  color: #2563eb;
}
.dash-type-stat,
.dash-priority-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.dash-priority-stat {
  padding: 4px;
  border-radius: 10px;
}
.dash-type-stat strong,
.dash-priority-stat strong,
.dash-type-ratio strong {
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 800;
  color: #111827;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-type-ratio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  border-left: 1px solid #e5e7eb;
  padding-left: 12px;
}
.dash-type-ratio span {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  max-width: 9rem;
}
.dash-type-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  justify-content: center;
}
.dash-type-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.dash-vbars {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  min-height: 260px;
  padding: 4px 2px 0;
}
.dash-vbar-col {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  justify-items: center;
  gap: 6px;
}
.dash-vbar-col.is-empty {
  opacity: 0.55;
}
.dash-vbar-total {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-height: 12px;
}
.dash-vbar-shaft {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 0 4px;
}
.dash-vbar-stack {
  width: min(100%, 52px);
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  border-radius: 0;
  overflow: visible;
  min-height: 0;
  gap: 1px;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.1));
}
.dash-vbar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
  border: 0;
  padding: 5px 2px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  color: #fff;
  box-sizing: border-box;
  overflow: visible;
}
.dash-vbar-seg:first-child {
  border-radius: 0 0 4px 4px;
}
.dash-vbar-seg:last-child {
  border-radius: 8px 8px 0 0;
}
.dash-vbar-seg:only-child {
  border-radius: 8px 8px 4px 4px;
}
.dash-vbar-seg.is-empty {
  min-height: 4px;
  padding: 0;
  background: #e2e8f0;
  cursor: default;
  pointer-events: none;
  border-radius: 4px;
}
.dash-vbar-seg:hover,
.dash-vbar-seg:focus-visible {
  filter: brightness(1.06);
  outline: none;
}
.dash-vbar-seg-count {
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.25);
  padding: 1px 0;
}
.dash-vbar-counts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.dash-vbar-counts .tone-reactive {
  color: #2563eb;
}
.dash-vbar-counts .tone-preventive {
  color: #16a34a;
}
.dash-vbar-xlabel {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-priority-chart {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(180px, 1.2fr);
  gap: 12px;
  align-items: center;
  min-height: 240px;
  height: 100%;
}
.dash-priority-chart.is-clickable {
  cursor: pointer;
  border-radius: 12px;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
.dash-priority-chart.is-clickable:hover,
.dash-priority-chart.is-clickable:focus-visible {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #dbeafe;
  outline: none;
}
.dash-priority-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
}
.dash-priority-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 10px;
}
.dash-priority-grid--three {
  grid-template-columns: 1fr;
  gap: 12px;
}
.dash-priority-pct {
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.dash-priority-donut-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
}
.dash-priority-svg {
  width: 100%;
  max-width: 240px;
  height: auto;
  overflow: visible;
}
.dash-priority-arc {
  stroke-linecap: butt;
  pointer-events: stroke;
}
.dash-priority-center-value {
  fill: #111827;
  font-size: 22px;
  font-weight: 800;
  pointer-events: none;
}
.dash-priority-center-label {
  fill: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}
.dash-priority-value {
  fill: #fff;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}
.dash-priority-label {
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.dash-priority-leader {
  stroke-width: 1.5;
  pointer-events: none;
}

.dash-chart-tooltip {
  position: fixed;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  pointer-events: none;
  white-space: nowrap;
}
.dash-chart-tooltip.hidden { display: none; }
.dash-chart-tooltip-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dash-chart-orders-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(2080px, calc(100vw - 16px));
  max-height: min(90vh, 920px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dash-chart-orders-modal.hidden { display: none; }
.dash-priority-split-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 24px));
  max-height: min(88vh, 720px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  z-index: 91;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dash-priority-split-modal.hidden { display: none; }
.dash-priority-split-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #f3f4f6;
}
.dash-priority-split-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}
.dash-priority-split-head p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
}
.dash-priority-split-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 20px;
  overflow: auto;
}
.dash-priority-type-card {
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.dash-priority-type-card.tone-preventive {
  border-color: #bbf7d0;
}
.dash-priority-type-card.tone-reactive {
  border-color: #bfdbfe;
}
.dash-priority-type-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.dash-priority-type-card header strong {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.dash-priority-type-rows {
  display: grid;
  gap: 10px;
}
.dash-priority-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}
.dash-priority-type-row strong {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  font-variant-numeric: tabular-nums;
}
.dash-priority-type-row em {
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .dash-priority-split-body {
    grid-template-columns: 1fr;
  }
}
.dash-chart-orders-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #f3f4f6;
}
.dash-chart-orders-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}
.dash-chart-orders-head p {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}
.dash-chart-orders-body {
  padding: 0;
  overflow: hidden;
  min-height: 180px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.dash-chart-orders-body .table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.dash-chart-orders-table {
  margin: 0;
  width: 100%;
  min-width: 1440px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.dash-chart-orders-table th,
.dash-chart-orders-table td {
  padding-left: 12px;
  padding-right: 12px;
}
.dash-chart-orders-table th {
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: bottom;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f9fafb;
  box-shadow: inset 0 -1px 0 #e5e7eb;
}
.dash-chart-orders-table td {
  white-space: nowrap;
  overflow: hidden;
}
.dash-chart-orders-table .wo-list-title-cell,
.dash-chart-orders-table .wo-list-cell-clip {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-chart-orders-table .wo-list-col-id .wo-list-id-link,
.dash-chart-orders-table .wo-list-col-amazon-wo .wo-list-cell-clip,
.dash-chart-orders-table .wo-list-col-amazon-2d .wo-list-cell-clip {
  display: inline-block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.dash-chart-orders-table .wo-list-id-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.dash-chart-orders-table .wo-list-id-link:hover {
  text-decoration: underline;
}
.dash-chart-orders-table .wo-list-col-status {
  width: 220px;
}
.dash-chart-orders-table td.wo-list-col-status {
  white-space: normal;
  overflow: visible;
}
.dash-chart-orders-table td.wo-list-col-status .dash-badge {
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

@media (max-width: 1100px) {
  .dash-type-summary,
  .dash-type-summary--pair,
  .dash-type-summary--ratios,
  .dash-type-summary--periods {
    grid-template-columns: 1fr;
  }
  .dash-type-ratio,
  .dash-type-summary--ratios .dash-type-ratio:first-of-type {
    border-left: 0;
    border-top: 1px solid #e5e7eb;
    padding-left: 0;
    padding-top: 10px;
  }
  .dash-priority-chart {
    grid-template-columns: 1fr;
  }
  .dash-priority-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dash-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  min-height: 200px;
  padding-top: 8px;
}
.dash-bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.dash-bar-track {
  width: 100%;
  max-width: 48px;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dash-bar-fill {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  min-height: 4px;
  transition: height .3s ease;
}
.dash-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-align: center;
}
.dash-bar-value {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.dash-grouped-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
}
.dash-grouped-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-grouped-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.dash-grouped-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 200px;
  overflow-x: auto;
  padding: 4px 2px 0;
}
.dash-grouped-col {
  flex: 1 0 72px;
  min-width: 72px;
  max-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.dash-grouped-track {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}
.dash-grouped-bar {
  flex: 1;
  max-width: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.dash-grouped-fill {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  min-height: 0;
  transition: height .3s ease;
}
.dash-grouped-count {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  line-height: 1;
}

.dash-donut-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 200px;
}
.dash-donut {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  position: relative;
}
.dash-donut::before {
  content: "";
  position: absolute;
  inset: 22px;
  background: #fff;
  border-radius: 999px;
}
.dash-donut span {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 800;
  color: #111827;
}
.dash-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
  min-width: min(220px, 100%);
}
.dash-donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.dash-donut-legend strong { margin-left: auto; color: #111827; }
.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dash-table-wrap { overflow-x: auto; }
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
}
.dash-table td {
  padding: 12px;
  border-bottom: 1px solid #f9fafb;
  color: #374151;
  font-weight: 500;
}
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table-row { position: relative; }
.dash-table-accent-cell {
  position: relative;
  padding-left: 16px !important;
}
.dash-row-accent {
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
}
.dash-table-title-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.dash-table-link {
  color: #111827;
  font-weight: 700;
  text-decoration: none;
}
.dash-table-link:hover {
  color: #7c3aed;
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.dash-empty {
  margin: 0;
  padding: 48px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
}

@keyframes shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f3f4f6 0%, #eceff3 20%, #f3f4f6 40%, #f3f4f6 100%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

.app-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
  z-index: 13000;
}
.app-confirm-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 13001;
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  padding: 28px 24px 22px;
  text-align: center;
}
.app-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(102,126,234,.14), rgba(118,75,162,.1));
  color: #667eea;
}
.app-confirm-icon.is-danger {
  background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(220,38,38,.08));
  color: #dc2626;
}
.app-confirm-icon svg { width: 26px; height: 26px; }
.app-confirm-dialog h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}
.app-confirm-dialog p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: #6b7280;
  font-weight: 500;
}
.app-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.app-confirm-btn {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, transform .15s;
}
.app-confirm-btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.app-confirm-cancel {
  background: #f3f4f6;
  color: #374151;
}
.app-confirm-ok {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.28);
}
.app-confirm-ok.is-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.app-choice-host {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.app-choice-host.show {
  opacity: 1;
  pointer-events: auto;
}
.app-choice-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.app-choice-dialog {
  position: relative;
  width: min(440px, calc(100vw - 28px));
  background: #fff;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.app-choice-dialog.is-cards {
  width: min(560px, calc(100vw - 28px));
}
.app-choice-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.app-choice-message {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}
.app-choice-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.app-choice-list.is-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.app-choice-option {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.app-choice-list.is-cards .app-choice-option {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  min-height: 118px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.app-choice-option:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  transform: translateY(-1px);
}
.app-choice-list.is-cards .app-choice-option:hover {
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}
.app-choice-option.is-danger:hover {
  border-color: #fca5a5;
  background: #fef2f2;
}
.app-choice-option.tone-excel:hover {
  border-color: #86efac;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.12);
}
.app-choice-option.tone-pdf:hover {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.12);
}
.app-choice-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  flex-shrink: 0;
}
.app-choice-option.tone-excel .app-choice-option-icon {
  background: #ecfdf5;
  color: #15803d;
}
.app-choice-option.tone-pdf .app-choice-option-icon {
  background: #fef2f2;
  color: #dc2626;
}
.app-choice-option-icon svg {
  width: 22px;
  height: 22px;
}
.app-choice-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.app-choice-option-label {
  font-size: 14px;
  font-weight: 750;
  color: #0f172a;
}
.app-choice-list.is-cards .app-choice-option-label {
  font-size: 15px;
  font-weight: 800;
}
.app-choice-option-desc {
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}
.app-choice-actions {
  margin-top: 14px;
}
@media (max-width: 560px) {
  .app-choice-list.is-cards {
    grid-template-columns: 1fr;
  }
}

.dash-skeleton-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  min-height: 200px;
  padding-top: 8px;
}
.dash-skeleton-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.skeleton-bar {
  width: 100%;
  max-width: 48px;
  height: 120px;
}
.skeleton-bar-label {
  width: 36px;
  height: 10px;
}

.dash-skeleton-donut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 200px;
}
.skeleton-donut {
  width: 140px;
  height: 140px;
  border-radius: 999px;
}
.dash-skeleton-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 160px;
}
.skeleton-legend-row {
  width: 100%;
  height: 14px;
}

.dash-skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}
.skeleton-table-row {
  width: 100%;
  height: 42px;
}

/* ── JHA document editor ── */
.jha-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1200;
}
.jha-editor {
  position: fixed;
  inset: 12px;
  z-index: 1210;
  background: #e8eaed;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.jha-editor-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.jha-editor-toolbar-left {
  flex: 1;
  min-width: 0;
  padding-right: 48px;
}
.jha-editor-toolbar-left h3 {
  margin: 0;
  font-size: 1.05rem;
}
.jha-editor-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.jha-editor-footer .btn {
  min-width: 110px;
  padding: 10px 20px;
  font-size: 0.9rem;
}
.jha-editor-scroll {
  flex: 1;
  overflow: auto;
  padding: 12px 16px;
  background: #d8dce3;
}
.jha-document {
  width: 100%;
  max-width: none;
  margin: 0;
}
.jha-doc-page-section {
  width: 100%;
  max-width: none;
}
.jha-doc-page-section + .jha-doc-page-section {
  margin-top: 32px;
  padding-top: 8px;
  border-top: 2px dashed #ddd;
}
.jha-doc-page,
.jha-doc-document {
  background: #fff;
  padding: 20px 24px 40px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  color: #000;
  line-height: 1.35;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  box-sizing: border-box;
}
.jha-doc-logo {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
.jha-logo-cell {
  padding: 2px;
  vertical-align: middle;
  text-align: center;
}
.jha-title-cell {
  text-align: center;
  vertical-align: middle;
  padding: 2px 4px;
}
.jha-revision-cell {
  font-size: 8pt;
  white-space: normal;
  vertical-align: middle;
  text-align: left;
  line-height: 1.2;
  padding: 2px 3px;
}
.jha-title-table {
  width: 100%;
  table-layout: fixed;
}
.jha-doc-title {
  font-size: 12pt;
  font-weight: 700;
  text-align: center;
  margin: 0;
  color: #0000ff;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}
.jha-header-gray {
  background: #d9d9d9 !important;
  color: #000;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}
.jha-text-red {
  color: #ff0000 !important;
}
.jha-text-bold {
  font-weight: 700;
}
.jha-spacer-col {
  width: 12px;
  border-left: none !important;
  border-right: none !important;
  background: #fff;
  padding: 0 !important;
}
.jha-qr-cell {
  text-align: center;
  vertical-align: middle;
  padding: 2px !important;
  overflow: hidden;
}
.jha-qr-code {
  width: 80px;
  height: 80px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
.jha-orient-wrap {
  vertical-align: top;
  padding: 6px 8px !important;
}
.jha-orient-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.jha-orient-text {
  flex: 1;
  min-width: 0;
}
.jha-orient-qr {
  flex-shrink: 0;
  width: 76px;
  text-align: right;
}
.jha-orient-question {
  margin: 0 0 6px;
}
.jha-orient-note {
  margin: 6px 0 0;
}
.jha-orient-yes-line {
  margin: 0;
}
.jha-ppe-wrap {
  padding: 6px 0 !important;
  vertical-align: top;
}
.jha-ppe-columns {
  display: flex;
  width: 100%;
  align-items: stretch;
}
.jha-ppe-columns .jha-ppe-col {
  flex: 1 1 50%;
  min-width: 0;
  padding: 2px 10px;
  box-sizing: border-box;
}
.jha-ppe-columns .jha-ppe-col + .jha-ppe-col {
  border-left: 1px solid #333;
}
.jha-main-grid .jha-ppe-row td.jha-ppe-wrap {
  padding-left: 8px !important;
  padding-right: 8px !important;
}
.jha-ppe-entry {
  margin-bottom: 5px;
}
.jha-ppe-specify {
  margin: 2px 0 6px 20px;
}
.jha-ppe-specify .jha-specify-input {
  width: 100%;
  max-width: 100%;
  display: block;
}
.jha-orient-yes {
  vertical-align: middle;
  text-align: center;
}
.jha-yesno-cell {
  text-align: center;
  white-space: nowrap;
}
.jha-yesno {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 10px;
  font-weight: normal;
  cursor: pointer;
}
.jha-ppe-col {
  vertical-align: top;
}
.jha-ppe-header {
  margin: 6px 0 4px;
  font-size: 9.5pt;
  font-weight: 700;
}
label.jha-ppe-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  margin-bottom: 3px;
  cursor: pointer;
}
.jha-ppe-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
}
.jha-ppe-item span {
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}
.jha-ack-text {
  font-size: 10pt;
  padding: 10px 8px;
}
.jha-note {
  margin: 8px 0;
  font-size: 10pt;
}
.jha-instructions-cell {
  padding: 8px;
}
.jha-note-cell {
  padding: 6px 8px;
  font-size: 10pt;
}
.jha-management-table {
  table-layout: fixed;
}
.jha-management-table .jha-task-header-row th {
  text-align: center;
  vertical-align: middle;
}
.jha-management-table .jha-task-row td[colspan="2"]:first-child {
  vertical-align: top;
}
.jha-hazard-grid-title-row .jha-title-cell {
  text-align: center;
  vertical-align: middle;
  padding: 6px 4px;
}
.jha-hazard-grid-title-row .jha-revision-cell {
  font-size: 8pt;
  vertical-align: middle;
}
.jha-hazard-grid-title-spacer {
  background: #fff;
}
.jha-hazard-grid-instructions-row .jha-instructions-cell {
  padding: 6px 8px;
}
.jha-hazard-grid-instructions-row .jha-instructions-cell p {
  margin: 4px 0;
  font-size: 9pt;
  line-height: 1.2;
}
.jha-hazard-symbol {
  width: 42px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.jha-hazard-icon {
  width: 52px;
  text-align: center;
  vertical-align: middle;
  background: #fff;
}
.jha-hazard-label {
  font-size: 9.5pt;
  vertical-align: middle;
  background: #fff;
}
.jha-hazard-cat-header .jha-hazard-label {
  min-width: 0;
  max-width: 100%;
  background: transparent !important;
}
.jha-hazard-label-active,
.jha-hazard-active .jha-hazard-label,
.jha-hazard-active .jha-hazard-icon {
  background: #ffff00 !important;
}
.jha-hazard-controls {
  font-size: 8.5pt;
  vertical-align: top;
}
.jha-hazard-select {
  text-align: center;
  vertical-align: middle;
  width: 28px;
}
.jha-swa-quote {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid #333;
  font-size: 10pt;
  background: #fff;
  text-align: center;
}
.jha-textarea-inline {
  display: inline-block;
  width: calc(100% - 140px);
  vertical-align: top;
  min-height: 36px;
}
.jha-orient-q,
.jha-orient-note {
  font-size: 8pt;
  line-height: 1.15;
  vertical-align: top;
  padding: 2px 3px !important;
}
.jha-orient-yes {
  text-align: center;
  vertical-align: top;
  padding: 2px 3px !important;
}
.jha-doc-page-1 .jha-title-table {
  margin-bottom: 0;
}
.jha-doc-page-1 .jha-main-grid {
  margin-bottom: 0;
  margin-top: 0;
}
.jha-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  font-size: 9pt;
}
.jha-doc-table th,
.jha-doc-table td {
  border: 1px solid #333;
  padding: 2px 4px;
  vertical-align: top;
}
.jha-main-grid,
.jha-hazard-table,
.jha-task-table,
.jha-section-table,
.jha-management-table {
  table-layout: fixed;
}
/* Word row heights (twips / 1440) */
.jha-tt-r1 { min-height: 0.304in; }
.jha-tt-r2 { min-height: 0.378in; }
.jha-tt-r3 { min-height: 0.321in; }
.jha-tt-r4 { min-height: 0.3in; }
.jha-mg-r1 { min-height: 0.168in; }
.jha-mg-r2 { min-height: 0.31in; }
.jha-mg-r3 { min-height: 0.18in; }
.jha-mg-r4 { min-height: 0.349in; }
.jha-mg-r5 { min-height: 0.162in; }
.jha-mg-r6 { min-height: 0.199in; }
.jha-mg-r7 { min-height: 0.106in; }
.jha-mg-r8 { min-height: 0.194in; }
.jha-mg-r9 { min-height: 0.162in; }
.jha-mg-r10 { min-height: 1.187in; }
.jha-mg-r11 { min-height: 0.399in; }
.jha-mg-r12,
.jha-mg-r13 { min-height: 0.22in; }
.jha-mg-r14 { min-height: 0.295in; }
.jha-mg-r15 { min-height: 0.149in; }
.jha-mg-r16 { min-height: 0.25in; }
.jha-mg-r17 { min-height: 0.267in; }
.jha-hg-r1 { min-height: 0.3in; }
.jha-hg-r2 { min-height: 0.35in; }
.jha-hg-r3,
.jha-hg-r5,
.jha-hg-r7,
.jha-hg-r9 { min-height: 0.38in; }
.jha-hg-r4,
.jha-hg-r6,
.jha-hg-r8,
.jha-hg-r10 { min-height: 1.35in; }
.jha-hm-r1 { min-height: 0.243in; }
.jha-hm-r2 { min-height: 0.5in; }
.jha-hm-r3 { min-height: 0.204in; }
.jha-hm-r3 td {
  text-align: center;
  vertical-align: middle;
}
.jha-hm-r5 { min-height: 0.403in; }
.jha-hm-r6 { min-height: 1.62in; }
.jha-hm-r7,
.jha-hm-r8,
.jha-hm-r9 { min-height: 1.3in; }
.jha-hc-r1 { min-height: 0.191in; }
.jha-hc-r2 { min-height: 0.144in; }
.jha-hc-r3 { min-height: 0.149in; }
.jha-hc-r4,
.jha-hc-r5,
.jha-hc-r6,
.jha-hc-r7,
.jha-hc-r8,
.jha-hc-r9,
.jha-hc-r10,
.jha-hc-r11,
.jha-hc-r12,
.jha-hc-r13,
.jha-hc-r14,
.jha-hc-r15,
.jha-hc-r16 { min-height: 0.25in; }
.jha-doc-table th {
  background: #d9d9d9;
  font-weight: 700;
  text-align: left;
}
.jha-field-cell {
  font-size: 8.5pt;
  vertical-align: top;
  padding: 2px 4px;
}
.jha-field-label {
  display: block;
  margin-bottom: 4px;
  line-height: 1.2;
}
.jha-field-label strong {
  font-weight: 700;
  white-space: normal;
}
.jha-field-value {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.jha-field-cell.jha-field-permit .jha-field-label {
  line-height: 1.15;
}
.jha-field-cell.jha-field-date .jha-field-label {
  text-align: left;
}
.jha-field-cell.jha-field-date .jha-field-value,
.jha-field-cell.jha-field-date .jha-print-field {
  text-align: right;
}
.jha-textarea-assigned {
  min-height: 64px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.jha-completion-sign-name,
.jha-completion-row [data-jha-completion^="sign_"] {
  font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: 16px;
  line-height: 1.25;
  color: #111;
}
.jha-completion-sign-name:read-only,
.jha-completion-row [data-jha-completion^="sign_"]:read-only {
  background: transparent;
  cursor: default;
}
.jha-signature-image {
  display: block;
  height: 28px;
  max-width: 240px;
  object-fit: contain;
  object-position: left center;
}
.jha-assigned-print-list {
  display: block;
  white-space: pre-line;
  line-height: 1.35;
}
.jha-field-cell.jha-field-date .bs-us-date-picker-btn {
  flex: 0 0 auto;
}
.jha-field-cell strong {
  white-space: normal;
  margin-right: 0;
}
.jha-inline-input {
  border: none;
  border-bottom: 1px solid #999;
  background: transparent;
  font: inherit;
  width: 100%;
  min-width: 60px;
  padding: 2px 0;
  color: #111;
}
.jha-inline-input:focus {
  outline: none;
  border-bottom-color: var(--primary);
  background: #f0f7ff;
}
.jha-full-width {
  width: 100%;
}
.jha-textarea {
  width: 100%;
  border: 1px solid #ccc;
  background: #fafafa;
  font: inherit;
  padding: 6px 8px;
  resize: vertical;
  min-height: 48px;
}
.jha-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.jha-doc-block {
  margin-bottom: 12px;
}
.jha-radio-group {
  white-space: nowrap;
}
.jha-radio-group label {
  margin-right: 16px;
  font-weight: normal;
  cursor: pointer;
}
.jha-check-label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-weight: normal;
  margin-bottom: 4px;
  cursor: pointer;
}
.jha-check-sm {
  font-size: 9pt;
}
.jha-ppe-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.jha-specify-input {
  max-width: 120px;
  margin-left: 4px;
  display: inline-block;
  width: auto;
  flex: 1;
}
.jha-static-text {
  margin: 0;
  font-size: 10pt;
}
.jha-instructions {
  font-size: 9.5pt;
  margin: 0 0 12px;
  color: #000;
}
.jha-hazard-table {
  width: 100%;
  table-layout: fixed;
}
.jha-hazard-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.jha-hazard-grid .jha-hazard-cat-col {
  padding: 0;
  vertical-align: top;
}
.jha-hazard-cat-header {
  display: grid;
  grid-template-columns: 13px 20px minmax(0, 1fr);
  align-items: center;
  column-gap: 2px;
  background: #ffff00;
  padding: 2px 3px;
  min-height: 34px;
  box-sizing: border-box;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.jha-hazard-cat-cb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  min-width: 13px;
  max-width: 13px;
  flex-shrink: 0;
  overflow: hidden;
}
.jha-hazard-cat-cb .jha-hazard-selected-cb,
.jha-hazard-cat-cb .jha-hazard-header-cb-print {
  width: 11px;
  height: 11px;
  margin: 0;
  flex-shrink: 0;
  font-size: 8pt;
  line-height: 1;
  text-align: center;
}
.jha-hazard-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  flex-shrink: 0;
  overflow: hidden;
}
.jha-hazard-cat-header .jha-hazard-symbol {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  object-fit: contain;
  display: block;
}
.jha-hazard-cat-header .jha-hazard-label {
  display: block;
  font-size: 6.5pt;
  font-weight: 700;
  line-height: 1.15;
  min-width: 0;
  max-width: 100%;
  background: transparent !important;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  padding: 0 1px;
  box-sizing: border-box;
}
.jha-hazard-cat-body {
  background: #fff;
  padding: 3px 4px;
  font-size: 6.5pt;
  line-height: 1.2;
  min-height: 1.2in;
}
.jha-hazard-cat-body .jha-check-label {
  margin-bottom: 2px;
  gap: 3px;
  font-size: 6.5pt;
  line-height: 1.2;
  align-items: flex-start;
}
.jha-hazard-cat-body .jha-check-label input[type="checkbox"] {
  width: 11px;
  height: 11px;
  margin-top: 1px;
  flex-shrink: 0;
}
.jha-hazard-cat-empty {
  background: #fff;
}
.jha-hazard-active .jha-hazard-cat-header {
  background: #ffff00 !important;
}
.jha-empty-box {
  min-height: 20px;
}
.jha-work-team-declaration {
  text-align: left;
  text-transform: none;
  font-weight: 700;
  line-height: 1.25;
}
.jha-main-grid .jha-ppe-col-left {
  padding: 6px 4px 6px 8px !important;
  vertical-align: top;
}
.jha-main-grid .jha-ppe-col-right {
  padding: 6px 8px 6px 4px !important;
  vertical-align: top;
  border-left: 1px solid #333;
}
.jha-header-yellow {
  background: #ffff00 !important;
  color: #000;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}
.jha-ack-highlight {
  background: #ffff00;
}
.jha-completion-table th.jha-header-gray,
.jha-completion-table td.jha-header-gray {
  text-align: center;
  text-transform: uppercase;
}
.jha-hazard-table .jha-hazard-label {
  font-size: 9.5pt;
  vertical-align: middle;
  text-align: left;
}
.jha-hazard-table .jha-hazard-icon,
.jha-hazard-table .jha-hazard-select {
  vertical-align: middle;
}
.jha-control-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.jha-swa-quote {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid #333;
  font-size: 10pt;
  background: #fff;
  text-align: center;
}
.jha-page-break {
  page-break-before: always;
  break-before: page;
  margin-top: 32px;
  padding-top: 8px;
  border-top: 2px dashed #ddd;
}
.jha-page-break-screen-only {
  page-break-before: auto;
  break-before: auto;
  margin-top: 32px;
  padding-top: 8px;
  border-top: 2px dashed #ddd;
}
.jha-add-row-wrap {
  margin: 8px 0 16px;
}
.jha-document.is-readonly input,
.jha-document.is-readonly textarea,
.jha-document.is-readonly select {
  pointer-events: none;
  background: transparent;
  border-color: transparent;
}
.jha-document.is-readonly .jha-inline-input {
  border-bottom-color: #ddd;
}
.jha-document.is-readonly .no-print {
  display: none !important;
}

@media print {
  body:not(.jha-print-body) {
    background: #fff;
  }

  body:not(.jha-print-body) .sidebar,
  body:not(.jha-print-body) .sidebar-open-btn,
  body:not(.jha-print-body) .sidebar-backdrop,
  body:not(.jha-print-body) .topnav,
  body:not(.jha-print-body) .topnav-backdrop,
  body:not(.jha-print-body) .jha-editor-overlay,
  body:not(.jha-print-body) .jha-editor-toolbar,
  body:not(.jha-print-body) .jha-editor-footer,
  body:not(.jha-print-body) .jha-page > .page-hero-card,
  body:not(.jha-print-body) .jha-page > .table-panel,
  body:not(.jha-print-body) .jha-page > #jhaError,
  body:not(.jha-print-body) .no-print,
  body:not(.jha-print-body) .toast-host,
  body:not(.jha-print-body) .app-confirm-dialog,
  body:not(.jha-print-body) .app-confirm-overlay {
    display: none !important;
  }

  body:not(.jha-print-body) .app-shell {
    display: none !important;
  }

  body:not(.jha-print-body) .content,
  body:not(.jha-print-body) .crud-page,
  body:not(.jha-print-body) .jha-page {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  body:not(.jha-print-body) .jha-editor {
    position: static !important;
    display: block !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: #fff !important;
    border-radius: 0 !important;
  }

  body:not(.jha-print-body) .jha-editor-scroll {
    overflow: visible !important;
    padding: 0 !important;
    height: auto !important;
  }

  body:not(.jha-print-body) .jha-doc-page,
  body:not(.jha-print-body) .jha-doc-document {
    box-shadow: none !important;
    padding: 12mm !important;
    max-width: none !important;
  }

  body:not(.jha-print-body) .jha-page-break {
    page-break-before: always;
    border: none !important;
    margin-top: 0 !important;
  }
}

body.jha-print-body {
  margin: 0;
  padding: 0;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  color: #000;
  width: 100%;
}

body.jha-print-body .jha-doc-page,
body.jha-print-body .jha-doc-document {
  box-shadow: none;
  padding: 0;
  max-width: none;
  width: 100%;
}

body.jha-print-body .jha-doc-page-section {
  width: 100%;
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

/* 4-page Word layout (landscape):
   Page 1 = Safe Work Plan
   Page 2 = Pre-Job Hazard Assessment
   Page 3 = Hazard Management
   Page 4 = SWA quote + Completion */
body.jha-print-body .jha-doc-page-2,
body.jha-print-body .jha-doc-page-3,
body.jha-print-body .jha-doc-page-4 {
  page-break-before: always;
  break-before: page;
}

/* Page 1 — Safe Work Plan */
body.jha-print-body .jha-doc-page-1 {
  font-size: 8pt;
  line-height: 1.15;
}

body.jha-print-body .jha-doc-page-1 .jha-doc-logo {
  width: 52px;
  height: 52px;
}

body.jha-print-body .jha-doc-page-1 .jha-doc-title {
  font-size: 11pt;
  margin: 0;
}

body.jha-print-body .jha-doc-page-1 .jha-title-table .jha-field-cell {
  padding: 3px 5px;
}

body.jha-print-body .jha-doc-page-1 .jha-main-grid td,
body.jha-print-body .jha-doc-page-1 .jha-main-grid th {
  padding: 1px 3px;
  font-size: 7.5pt;
  line-height: 1.15;
}

body.jha-print-body .jha-doc-page-1 .jha-ppe-col,
body.jha-print-body .jha-doc-page-1 .jha-ppe-col .jha-ppe-item,
body.jha-print-body .jha-doc-page-1 .jha-ppe-col .jha-ppe-header,
body.jha-print-body .jha-doc-page-1 .jha-ppe-col .jha-print-check {
  font-size: 7pt;
  line-height: 1.1;
}

body.jha-print-body .jha-doc-page-1 .jha-ppe-item {
  margin-bottom: 1px;
  gap: 4px;
  grid-template-columns: 14px 1fr;
}

body.jha-print-body .jha-doc-page-1 .jha-ppe-header {
  margin: 2px 0;
  font-size: 8pt;
}

body.jha-print-body .jha-doc-page-1 .jha-work-area-item {
  margin-bottom: 2px;
  gap: 5px;
}

body.jha-print-body .jha-doc-page-1 .jha-textarea,
body.jha-print-body .jha-doc-page-1 .jha-textarea-inline {
  min-height: 0;
}

body.jha-print-body .jha-doc-page-1 .jha-qr-code {
  width: 50px;
  height: 50px;
  max-width: 50px;
}

body.jha-print-body .jha-doc-page-1 .jha-ack-text,
body.jha-print-body .jha-doc-page-1 .jha-orient-question,
body.jha-print-body .jha-doc-page-1 .jha-orient-note {
  margin: 3px 0;
  font-size: 8pt;
}

body.jha-print-body .jha-doc-page-1 .jha-main-grid .jha-mg-r10 {
  height: 1.187in;
  min-height: 1.187in;
}

body.jha-print-body .jha-doc-page-3 .jha-hm-r6 {
  height: 1.62in;
  min-height: 1.62in;
}

body.jha-print-body .jha-doc-page-3 .jha-hm-r7,
body.jha-print-body .jha-doc-page-3 .jha-hm-r8,
body.jha-print-body .jha-doc-page-3 .jha-hm-r9 {
  height: 1.3in;
  min-height: 1.3in;
}

body.jha-print-body .jha-completion-table .jha-hc-r4,
body.jha-print-body .jha-completion-table .jha-hc-r5,
body.jha-print-body .jha-completion-table .jha-hc-r6,
body.jha-print-body .jha-completion-table .jha-hc-r7,
body.jha-print-body .jha-completion-table .jha-hc-r8,
body.jha-print-body .jha-completion-table .jha-hc-r9,
body.jha-print-body .jha-completion-table .jha-hc-r10,
body.jha-print-body .jha-completion-table .jha-hc-r11,
body.jha-print-body .jha-completion-table .jha-hc-r12,
body.jha-print-body .jha-completion-table .jha-hc-r13,
body.jha-print-body .jha-completion-table .jha-hc-r14,
body.jha-print-body .jha-completion-table .jha-hc-r15,
body.jha-print-body .jha-completion-table .jha-hc-r16 {
  height: 0.25in;
  min-height: 0.25in;
}

body.jha-print-body .jha-doc-table th,
body.jha-print-body .jha-doc-table td {
  padding: 1px 3px !important;
}

body.jha-print-body .jha-orient-q,
body.jha-print-body .jha-orient-note {
  font-size: 7pt;
  line-height: 1.1;
}

body.jha-print-body .jha-doc-page-1 .jha-qr-code {
  width: 58px;
  height: 58px;
  max-width: 58px;
}

/* Page 2 — Pre-Job Hazard Assessment */
body.jha-print-body .jha-doc-page-2 {
  font-size: 7pt;
  line-height: 1.15;
}

body.jha-print-body .jha-doc-page-2 .jha-hazard-grid-title-row .jha-doc-title {
  font-size: 12pt;
  margin: 0;
}

body.jha-print-body .jha-doc-page-2 .jha-hazard-grid-instructions-row .jha-instructions-cell {
  padding: 3px 5px;
}

body.jha-print-body .jha-doc-page-2 .jha-hazard-grid-instructions-row .jha-instructions-cell p {
  margin: 2px 0;
  font-size: 7pt;
  line-height: 1.15;
}

body.jha-print-body .jha-hazard-grid {
  page-break-inside: avoid;
  break-inside: avoid;
}

body.jha-print-body .jha-hazard-grid .jha-hazard-cat-col {
  padding: 0 !important;
}

body.jha-print-body .jha-hazard-cat-header {
  display: grid !important;
  grid-template-columns: 13px 20px minmax(0, 1fr) !important;
  background: #ffff00 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  padding: 2px 3px;
  min-height: 0.38in;
  height: auto !important;
  overflow: hidden;
  box-sizing: border-box;
}

body.jha-print-body .jha-hazard-cat-header .jha-hazard-label {
  font-size: 6.5pt;
  line-height: 1.15;
  min-width: 0 !important;
  max-width: 100%;
  overflow-wrap: break-word;
}

body.jha-print-body .jha-hazard-cat-header .jha-hazard-symbol {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
}

body.jha-print-body .jha-hazard-cat-header .jha-hazard-header-cb-print,
body.jha-print-body .jha-hazard-cat-header .jha-print-check {
  display: block;
  width: 11px;
  min-width: 11px;
  max-width: 11px;
  margin: 0 auto;
  padding: 0;
  font-size: 7pt;
  line-height: 1;
  text-align: center;
  flex: none;
}

body.jha-print-body .jha-hazard-grid-header-row {
  height: auto !important;
  min-height: 0.38in;
}

body.jha-print-body .jha-hg-r3,
body.jha-print-body .jha-hg-r5,
body.jha-print-body .jha-hg-r7,
body.jha-print-body .jha-hg-r9 {
  height: auto !important;
  min-height: 0.38in;
}

body.jha-print-body .jha-hazard-cat-body {
  padding: 2px 3px;
  font-size: 6.5pt;
  line-height: 1.15;
  background: #fff !important;
  min-height: 1.2in;
}

body.jha-print-body .jha-hazard-cat-body .jha-check-label,
body.jha-print-body .jha-hazard-cat-body .jha-print-check {
  margin-bottom: 1px;
  font-size: 6.5pt;
  line-height: 1.15;
  gap: 2px;
}

body.jha-print-body .jha-hg-r4,
body.jha-print-body .jha-hg-r6,
body.jha-print-body .jha-hg-r8,
body.jha-print-body .jha-hg-r10 {
  min-height: 1.35in;
}

body.jha-print-body .jha-empty-box {
  min-height: 16px;
}

body.jha-print-body .jha-work-team-declaration {
  text-align: left;
  text-transform: none;
}

body.jha-print-body .jha-main-grid .jha-ppe-col-right {
  border-left: 1px solid #333;
}

/* Page 3 — Hazard Management */
body.jha-print-body .jha-doc-page-3 {
  font-size: 8.5pt;
  line-height: 1.2;
}

body.jha-print-body .jha-doc-page-3 .jha-doc-title {
  font-size: 10pt;
}

body.jha-print-body .jha-doc-page-3 .jha-management-table .jha-note-cell,
body.jha-print-body .jha-doc-page-3 .jha-management-table .jha-instructions-cell {
  margin: 0;
  padding: 3px 5px;
  font-size: 7.5pt;
  line-height: 1.2;
}

body.jha-print-body .jha-doc-page-3 .jha-management-table td,
body.jha-print-body .jha-doc-page-3 .jha-management-table th {
  padding: 3px 4px;
  font-size: 7.5pt;
  line-height: 1.15;
}

body.jha-print-body .jha-doc-page-3 .jha-management-table .jha-task-row td {
  min-height: 36px;
  vertical-align: top;
}

body.jha-print-body .jha-doc-page-3 .jha-management-table .jha-header-yellow {
  background: #ffff00 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body.jha-print-body .jha-doc-page-3 .jha-task-table .jha-header-yellow {
  background: #ffff00 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body.jha-print-body .jha-doc-page-4 .jha-completion-table .jha-header-yellow {
  background: #ffff00 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body.jha-print-body .jha-doc-page-4 .jha-completion-table .jha-header-gray {
  background: #d9d9d9 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body.jha-print-body .jha-doc-page-4 {
  margin-top: 0;
}

body.jha-print-body .jha-ack-highlight {
  background: #ffff00 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body.jha-print-body .jha-doc-table th.jha-header-yellow {
  background: #ffff00 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
body.jha-print-body .jha-doc-page-3,
body.jha-print-body .jha-doc-page-4 {
  font-size: 8.5pt;
  line-height: 1.2;
  min-height: 0;
  margin-top: 0;
  padding-top: 0;
}

body.jha-print-body .jha-doc-page-3 .jha-doc-title,
body.jha-print-body .jha-doc-page-4 .jha-section-table th {
  font-size: 10pt;
}

body.jha-print-body .jha-doc-page-4 .jha-section-table td,
body.jha-print-body .jha-doc-page-4 .jha-section-table th {
  padding: 4px 6px;
  font-size: 8pt;
}

body.jha-print-body .jha-doc-page-4 .jha-completion-row td {
  min-height: 28px;
  vertical-align: bottom;
}

body.jha-print-body .jha-doc-table {
  width: 100% !important;
  max-width: none !important;
  table-layout: fixed;
}

body.jha-print-body .jha-doc-page-4 .jha-swa-quote {
  margin: 0 0 8px;
  padding: 6px 8px;
  font-size: 8pt;
  line-height: 1.2;
  text-align: center;
  border: none;
}

body.jha-print-body .jha-title-table,
body.jha-print-body .jha-main-grid,
body.jha-print-body .jha-hazard-table,
body.jha-print-body .jha-task-table,
body.jha-print-body .jha-management-table,
body.jha-print-body .jha-section-table {
  width: 100% !important;
}

body.jha-print-body .jha-orient-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

body.jha-print-body .jha-orient-qr {
  flex-shrink: 0;
}

body.jha-print-body .jha-qr-code {
  width: 68px;
  height: 68px;
  max-width: 68px;
  object-fit: contain;
}

body.jha-print-body .jha-ppe-columns {
  display: flex;
  width: 100%;
}
body.jha-print-body .jha-ppe-columns .jha-ppe-col {
  flex: 1 1 50%;
}

body.jha-print-body .jha-page-break {
  page-break-before: always;
  break-before: page;
  border: none;
  margin-top: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  line-height: 0;
}

body.jha-print-body .jha-page-break-screen-only {
  page-break-before: auto !important;
  break-before: auto !important;
  display: none;
}

body.jha-print-body .no-print {
  display: none !important;
}

body.jha-print-body .jha-print-field {
  display: inline;
  border: none !important;
  border-bottom: none !important;
  text-decoration: none !important;
  min-width: 0;
  padding: 0;
  white-space: pre-wrap;
  box-sizing: border-box;
  background: transparent !important;
}

body.jha-print-body .jha-inline-input,
body.jha-print-body .jha-field-value,
body.jha-print-body .jha-textarea,
body.jha-print-body input,
body.jha-print-body textarea {
  border: none !important;
  border-bottom: none !important;
  text-decoration: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.jha-print-body .jha-field-cell .jha-print-field {
  display: block;
  width: 100%;
  margin-top: 0;
  min-width: 0;
  font-size: inherit;
  border: none !important;
}

body.jha-print-body .jha-field-cell.jha-field-date .jha-print-field {
  text-align: right;
}
body.jha-print-body .bs-us-date-picker-btn {
  display: none !important;
}
body.jha-print-body .jha-signature-image {
  display: block;
  height: 28px;
  max-width: 240px;
  object-fit: contain;
  object-position: left center;
}
body.jha-print-body .jha-assigned-print-list {
  white-space: pre-line;
  line-height: 1.35;
}

body.jha-print-body .jha-title-table {
  table-layout: fixed !important;
}

body.jha-print-body .jha-title-table .jha-field-cell {
  overflow: hidden;
  padding: 4px 5px;
  vertical-align: top;
}

body.jha-print-body .jha-field-label {
  display: block;
  font-size: 8pt;
  line-height: 1.2;
  margin-bottom: 2px;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

body.jha-print-body .jha-inline-input,
body.jha-print-body .jha-field-value {
  min-width: 0 !important;
  border: none !important;
  border-bottom: none !important;
}

body.jha-print-body .jha-section-table .jha-completion-row td {
  border-bottom: 1px solid #333;
}

body.jha-print-body .jha-section-table .jha-print-field {
  display: block;
  width: 100%;
  min-height: 24px;
  border: none !important;
}

body.jha-print-body .jha-work-area-item,
body.jha-print-body .jha-print-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 1px;
}

body.jha-print-body .jha-textarea,
body.jha-print-body .jha-inline-input {
  border: none !important;
  background: transparent !important;
}

body.jha-print-body .jha-text-red {
  color: #ff0000 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body.jha-print-body .jha-header-gray,
body.jha-print-body .jha-hazard-label-active,
body.jha-print-body .jha-hazard-active .jha-hazard-label,
body.jha-print-body .jha-hazard-active .jha-hazard-icon {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

@media print {
  @page {
    size: letter landscape;
    margin: 8mm;
  }

  body.jha-print-body {
    padding: 0;
    width: 100%;
  }

  body.jha-print-body .jha-doc-page {
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body.jha-print-body .jha-doc-table {
    width: 100% !important;
    page-break-inside: auto;
  }

  body.jha-print-body .jha-orient-wrap {
    page-break-inside: auto;
    break-inside: auto;
  }

  body.jha-print-body .jha-hazard-row {
    page-break-inside: auto;
    break-inside: auto;
  }

  body.jha-print-body .jha-page-break {
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    line-height: 0;
  }

  body.jha-print-body .jha-page-break-screen-only {
    page-break-before: auto !important;
    break-before: auto !important;
    display: none;
  }

  body.jha-print-body .jha-hazard-table tbody {
    page-break-inside: auto;
  }
}

.jha-main-grid {
  table-layout: fixed;
  width: 100%;
}

.jha-main-grid .jha-ppe-col {
  vertical-align: top;
}

.jha-main-grid .jha-ppe-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  white-space: normal;
}

.jha-main-grid .jha-ppe-item span {
  min-width: 0;
  line-height: 1.25;
  word-break: normal;
  overflow-wrap: normal;
}

.jha-check-block {
  display: block;
  margin-bottom: 4px;
}

.jha-subheader {
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}

.jha-work-area-list {
  margin-top: 6px;
}

.jha-work-area-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: normal;
  cursor: pointer;
  line-height: 1.35;
}

.jha-work-area-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  flex-shrink: 0;
}

.jha-work-area-item span {
  flex: 1;
  min-width: 0;
}

.jha-main-grid col.jha-g-spacer {
  width: 16px;
}

.jha-main-grid .jha-spacer-col {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  padding: 0 !important;
  border-top: none !important;
  border-bottom: none !important;
}

.jha-main-grid td,
.jha-main-grid th {
  word-wrap: break-word;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROPOSAL TEMPLATE STYLES
═══════════════════════════════════════════════════════════════════════════ */

.proposal-page .page-hero-card { margin-bottom: 20px; }

/* Editor wrapper reuses jha-editor styles */
.proposal-editor-doc {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px 0;
}

.proposal-document {
  width: 100%;
  font-family: "Times New Roman", Times, serif;
}

.proposal-page-doc {
  background: #fff;
  padding: 0;
}

/* ── Header ── */
.prop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1a3a6e;
}

.prop-header-logo {
  flex: 1;
  min-width: 0;
}

.prop-logo-img {
  max-width: 220px;
  width: 220px;
  height: auto;
  display: block;
}

.prop-header-right {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.prop-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.prop-date-label {
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ── Tables ── */
.prop-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.82rem;
  font-family: "Times New Roman", Times, serif;
}

.prop-table th,
.prop-table td {
  border: 1px solid #999;
  padding: 5px 8px;
  vertical-align: middle;
}

.prop-th-section {
  background: #d9d9d9;
  font-weight: 700;
  text-align: center;
  font-size: 0.85rem;
  padding: 7px 8px;
  color: #000;
}

.prop-label-cell {
  background: #d9d9d9;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.8rem;
}

.prop-fixed-cell {
  font-size: 0.8rem;
}

.prop-input-cell {
  padding: 3px 6px;
}

.prop-inline-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #bbb;
  background: transparent;
  font-size: 0.82rem;
  font-family: inherit;
  padding: 2px 0;
  outline: none;
  color: #000;
}

.prop-inline-input:focus {
  border-bottom-color: #1a3a6e;
  background: #f0f4ff;
}

.prop-link {
  color: #1a3a6e;
  text-decoration: none;
}

/* ── Section titles ── */
.prop-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a3a6e;
  background: #e8edf5;
  padding: 5px 10px;
  margin: 16px 0 6px;
  border-left: 4px solid #1a3a6e;
  border-radius: 2px;
  page-break-after: avoid;
  break-after: avoid;
}

/* ── Scope description ── */
.prop-scope-description {
  min-height: 180px;
  line-height: 1.5;
  resize: vertical;
}

.prop-print-scope,
.prop-print-notes {
  display: block;
  width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.5;
}
.prop-print-scope p,
.prop-print-notes p,
.prop-print-line {
  margin: 0 0 0.45em;
  page-break-inside: avoid;
  break-inside: avoid;
}
.prop-print-scope ul,
.prop-print-notes ul,
.prop-print-scope ol,
.prop-print-notes ol {
  margin: 0.35em 0 0.35em 1.3em;
  padding: 0;
}
.prop-print-scope li,
.prop-print-notes li {
  margin: 0.12em 0;
  page-break-inside: avoid;
  break-inside: avoid;
}
.prop-print-scope b,
.prop-print-scope strong,
.prop-print-notes b,
.prop-print-notes strong {
  font-weight: 700;
}
.prop-print-scope i,
.prop-print-scope em,
.prop-print-notes i,
.prop-print-notes em {
  font-style: italic;
}

.prop-print-scope {
  min-height: 0;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 16px;
  background: transparent;
}

.prop-print-notes {
  min-height: 72px;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 16px;
  background: #fff;
}

/* ── Rich text ── */
.prop-richtext {
  margin-bottom: 16px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  overflow: visible;
  isolation: isolate;
}
.prop-richtext:focus-within {
  border-color: #1a3a6e;
}
.prop-richtext-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 8;
  box-shadow: 0 8px 10px -8px rgba(15, 23, 42, 0.22);
}
.prop-richtext-sep {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  margin: 0 2px;
}
.prop-richtext-size,
.prop-richtext-spacing {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.prop-richtext-size {
  min-width: 52px;
  padding: 0 18px 0 0;
}
.prop-richtext-size:hover,
.prop-richtext-spacing:hover,
.prop-richtext-color:hover {
  background: #eef2ff;
  border-color: #93c5fd;
}
.prop-richtext-select {
  height: 30px;
  min-width: 52px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.prop-richtext-select--size {
  width: 100%;
  min-width: 52px;
  padding: 0 4px 0 10px;
  text-align: left;
  box-shadow: none;
}
.prop-richtext-select--size::-ms-expand,
.prop-richtext-select--spacing::-ms-expand {
  display: none;
}
.prop-richtext-select-caret {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-42%);
  font-size: 9px;
  line-height: 1;
  color: #64748b;
  pointer-events: none;
}
.prop-richtext-btn {
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.prop-richtext-btn svg {
  display: block;
  width: 14px;
  height: 14px;
}
.prop-richtext-btn em {
  font-style: italic;
  font-weight: 700;
}
.prop-richtext-btn:hover {
  background: #eef2ff;
  border-color: #93c5fd;
}
.prop-richtext-btn.is-active {
  background: #dbeafe;
  border-color: #60a5fa;
}
.prop-richtext-btn--font {
  gap: 2px;
  min-width: 34px;
  padding: 0 7px;
}
.prop-richtext-a {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.prop-richtext-caret {
  font-size: 8px;
  line-height: 1;
  color: #2563eb;
  transform: translateY(-4px);
}
.prop-richtext-btn--step {
  min-width: 30px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.prop-richtext-spacing--icon {
  min-width: 44px;
  padding: 0 18px 0 8px;
}
.prop-richtext-spacing-face {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.prop-richtext-spacing-icon {
  width: 15px;
  height: 15px;
  color: #475569;
  display: block;
}
.prop-richtext-select--spacing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.prop-richtext-color {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  min-width: 42px;
  margin: 0;
  padding: 0 18px 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  flex: 0 0 auto;
  overflow: hidden;
}
.prop-richtext-color-face {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1;
  pointer-events: none;
}
.prop-richtext-color-letter {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  line-height: 1;
}
.prop-richtext-color-bar {
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: #dc2626;
}
.prop-richtext-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 1;
}
.prop-richtext-editor {
  min-height: 72px;
  max-height: min(62vh, 680px);
  overflow-y: auto;
  padding: 8px 10px;
  font-family: "Times New Roman", Times, serif;
  font-size: 12pt;
  line-height: 1.5;
  outline: none;
}
.prop-richtext-editor ul,
.prop-richtext-editor ol {
  margin: 0.35em 0 0.35em 1.3em;
  padding: 0;
}
.prop-richtext-editor:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
.entity-form.is-readonly .prop-richtext-toolbar {
  display: none;
}

/* ── Notes ── */
.prop-textarea {
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 6px 8px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 16px;
}

.prop-textarea:focus {
  border-color: #1a3a6e;
}

/* ── Terms ── */
.prop-terms-box {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: #fafafa;
}

.prop-terms-text {
  font-size: 0.72rem;
  line-height: 1.5;
  color: #444;
  margin: 0;
  font-family: "Times New Roman", Times, serif;
}

/* ── Signature ── */
.prop-sig-table { margin-top: 8px; }

.prop-sig-cell {
  padding: 12px 16px 8px;
  vertical-align: bottom;
}

.prop-sig-line {
  border-bottom: 1px solid #555;
  height: 36px;
  margin-bottom: 4px;
}

.prop-sig-label {
  font-size: 0.74rem;
  color: #555;
  text-align: center;
}

/* ── Print ── */
@media print {
  .proposal-editor-doc {
    max-width: none;
    padding: 0;
  }

  .prop-print-scope,
  .prop-print-notes {
    display: block !important;
  }

  .prop-print-scope {
    min-height: 0;
    border: none !important;
    padding: 0;
  }

  .prop-print-notes {
    min-height: 72px;
    border: 1px solid #000;
  }

  .prop-inline-input,
  .prop-textarea {
    display: none;
  }

  .prop-print-field {
    display: block;
    min-height: 14px;
    border-bottom: none;
  }

  .prop-header {
    border-bottom: 2px solid #1a3a6e;
  }

  .jha-editor-footer,
  .no-print {
    display: none !important;
  }
}

/* ── Proposal date picker ── */
.prop-date-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #bbb;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.prop-date-input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 4px 8px;
  background: transparent;
  color: #000;
  cursor: pointer;
  width: 140px;
}

.prop-date-input:focus {
  background: #f0f4ff;
}

.prop-date-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #1a3a6e;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.prop-date-icon:hover {
  background: #0d2550;
}

.prop-date-icon svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

/* ── Proposal badge image (EcoVadis) ── */
.prop-badge-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-bottom: 6px;
}

/* ── Logo fallback ── */
.prop-logo-fallback {
  display: flex;
  align-items: center;
}

.prop-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a3a6e;
  letter-spacing: -0.01em;
}

/* ── Print overrides for date picker ── */
@media print {
  .prop-date-picker-wrap { border: none; }
  .prop-date-input { display: none; }
  .prop-date-icon { display: none !important; }
  .prop-badge-img { width: 50px; height: 50px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Checklists ── */
.checklist-type-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.checklist-type-tab {
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.checklist-type-tab.active,
.checklist-type-tab:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.checklist-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 80;
}
.checklist-picker-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 81;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  padding: 24px;
}
.checklist-picker-head h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.checklist-picker-head p {
  margin: 0 0 18px;
  color: #64748b;
}
.checklist-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
}
.checklist-picker-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  cursor: pointer;
}
.checklist-picker-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.checklist-picker-card strong {
  font-size: 14px;
  color: #0f172a;
}
.checklist-picker-card span {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.checklist-editor-doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 28px 40px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.checklist-document {
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  background: #fff;
}
.checklist-brand-header {
  margin-bottom: 12px;
}
.checklist-doc-code {
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 4px;
}
.checklist-doc-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 16px;
  text-transform: uppercase;
}
.checklist-doc-subtitle {
  margin: -8px 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.checklist-section-title {
  font-size: 12px;
  font-weight: 800;
  margin: 18px 0 8px;
  text-transform: uppercase;
}
.checklist-safety-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  border-radius: 8px;
}
.checklist-safety-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.45;
}
.checklist-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.checklist-item {
  padding: 6px 0;
}
.checklist-select-all {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}
.checklist-select-all .checklist-item-text {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.checklist-check-label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
}
.checklist-check-label input[type="checkbox"] {
  position: absolute;
  left: 0;
  top: 2px;
  width: 14px;
  height: 14px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.checklist-check-box {
  flex-shrink: 0;
  width: 14px;
  font-size: 13px;
  line-height: 1.2;
}
.checklist-notes-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  min-height: 72px;
  resize: vertical;
}
.checklist-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.checklist-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}
.checklist-field input:not(.bs-us-date-display) {
  border: none;
  border-bottom: 1px solid #111;
  padding: 4px 0;
  font-size: 11px;
  background: transparent;
}
.checklist-field .bs-us-date-display {
  border: none !important;
  background: transparent;
}
.checklist-field-signature {
  grid-column: 1 / -1;
  min-width: 0;
}
.checklist-signatures-print-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  min-width: 0;
}
.checklist-signatures-print-grid .checklist-field-signature {
  grid-column: auto;
  min-width: 0;
}
.checklist-signature {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}
.checklist-signatures-print-grid .checklist-signature {
  max-width: none;
}
.checklist-signature-pad-wrap {
  position: relative;
  width: 100%;
}
.checklist-signature-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
}
.checklist-signature-name-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 220px;
  min-width: 0;
  font-size: 11px;
  color: #64748b;
}
.checklist-signature-name-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 7px 10px !important;
  background: #fff !important;
}
.checklist-signature-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.checklist-signature-pad {
  display: block;
  width: 100%;
  height: 96px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  touch-action: none;
  cursor: crosshair;
}
.checklist-signature-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 12px;
  pointer-events: none;
}
.checklist-signature.has-ink .checklist-signature-hint {
  display: none;
}
.checklist-signature-image {
  display: block;
  height: 48px;
  max-width: 240px;
  object-fit: contain;
  object-position: left center;
}
.checklist-signature-text {
  font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: 18px;
  line-height: 1.2;
}
.checklist-form.is-readonly input,
.checklist-form.is-readonly textarea,
.checklist-editor-doc.is-readonly input,
.checklist-editor-doc.is-readonly textarea {
  pointer-events: none;
}
.checklist-form.is-readonly .checklist-signature-pad,
.checklist-editor-doc.is-readonly .checklist-signature-pad,
.checklist-form.is-readonly .checklist-signature-actions,
.checklist-editor-doc.is-readonly .checklist-signature-actions,
.checklist-form.is-readonly .checklist-select-all,
.checklist-editor-doc.is-readonly .checklist-select-all {
  pointer-events: none;
}
.checklist-print-field {
  display: inline;
  min-width: 120px;
  padding: 0 2px 1px;
}
.checklist-footer-fields .checklist-print-field {
  border-bottom: 1px solid #111;
}
#checklistEditor .jha-editor-toolbar {
  position: relative;
  z-index: 12;
  flex-shrink: 0;
}
#checklistEditor .jha-editor-scroll {
  overscroll-behavior: contain;
}
@media (max-width: 640px) {
  .checklist-footer-grid { grid-template-columns: 1fr; }
}

/* ── Cost Management ── */
.wo-proposal-summary-card {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.wo-proposal-summary-card h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #0f172a;
}
.wo-proposal-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.wo-proposal-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wo-proposal-summary-item span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.wo-proposal-summary-item strong {
  font-size: 13px;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
}
.wo-proposal-summary-item.full {
  grid-column: 1 / -1;
}
#woProposalModalOverlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#woProposalModal.modal-card {
  position: fixed;
}
#woProposalModal.is-loading > :not(#woProposalModalLoader) {
  visibility: hidden;
  pointer-events: none;
}
#woProposalModal.is-loading > #woProposalModalLoader,
#woProposalModalLoader:not(.hidden) {
  display: grid !important;
}
#woProposalModalLoader {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#woProposalForm.entity-form.is-loading {
  pointer-events: none;
}
.wo-proposal-attachment-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wo-proposal-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.wo-proposal-attachment-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.wo-proposal-attachment-main .communication-file-chip {
  max-width: 100%;
}
.wo-proposal-attachment-item p {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
}
.wo-proposal-attachment-item small {
  color: #64748b;
}
.wo-proposal-vendor-rate-wrap.is-rate-locked input,
.wo-proposal-amazon-rate-wrap.is-rate-locked input {
  cursor: pointer;
  background: #f8fafc;
}
.wo-proposal-vendor-rate-wrap.is-rate-locked input:focus,
.wo-proposal-amazon-rate-wrap.is-rate-locked input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.wo-vendor-rate-popup {
  width: min(480px, calc(100vw - 32px));
  z-index: 1250;
  overflow: hidden;
  border: 1px solid #dbeafe;
  box-shadow: 0 28px 60px -28px rgba(15, 23, 42, 0.45);
}
#woVendorRatePopupOverlay,
#woAmazonRatePopupOverlay {
  z-index: 1240;
}
#woVendorRatePopup,
#woAmazonRatePopup {
  z-index: 1250;
}
.wo-proposal-preventive-2d {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #dbe3ef;
  display: grid;
  gap: 14px;
}
.wo-proposal-2d-balance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.wo-proposal-2d-balance > div {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}
.wo-proposal-2d-balance span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.wo-proposal-2d-balance strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  color: #0f172a;
}
.wo-proposal-2d-history {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}
.wo-proposal-2d-history h5 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.wo-proposal-2d-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.wo-proposal-2d-history-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #334155;
}
.wo-proposal-service-lines-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.wo-proposal-service-lines-list {
  display: grid;
  gap: 12px;
}
.wo-proposal-service-line {
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.wo-proposal-service-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wo-proposal-service-line-top strong {
  font-size: 13px;
  color: #0f2f8a;
}
.wo-proposal-service-line-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.wo-proposal-service-line-grid.is-qty-rate {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.7fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
}
.wo-proposal-service-line-grid .entity-field.full {
  grid-column: 1 / -1;
}
.wo-proposal-service-line-grid.is-qty-rate .entity-field.span-2 {
  grid-column: span 2;
}
@media (max-width: 720px) {
  .wo-proposal-2d-balance,
  .wo-proposal-service-line-grid,
  .wo-proposal-service-line-grid.is-qty-rate {
    grid-template-columns: 1fr;
  }
}
#woProposalVendorRateHint:not(.hidden),
#woProposalAmazonRateHint:not(.hidden) {
  color: #2563eb;
  cursor: pointer;
  font-weight: 600;
}
#woProposalVendorRateHint:not(.hidden):hover,
#woProposalAmazonRateHint:not(.hidden):hover {
  text-decoration: underline;
}
#woProposalAmazonRateStatusPills .wo-pill.active[data-amazon-rate-status="draft"] {
  background: #64748b;
  color: #fff;
  border-color: #64748b;
}
#woProposalAmazonRateStatusPills .wo-pill.active[data-amazon-rate-status="sent"] {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
#woProposalAmazonRateStatusPills .wo-pill.active[data-amazon-rate-status="accepted"] {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
#woProposalAmazonProposalSection.is-amazon-proposal-locked .wo-pill-group {
  opacity: 0.85;
}
.wo-vendor-rate-popup-header {
  align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eef2f7;
}
.wo-vendor-rate-popup-eyebrow {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wo-vendor-rate-popup-header h3 {
  font-size: 20px;
}
.wo-vendor-rate-popup-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 24px 24px;
  box-sizing: border-box;
}
.wo-vendor-rate-popup-total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 18px 20px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 55%, #ffffff 100%);
  color: #1e3a8a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.wo-vendor-rate-popup-total-copy {
  min-width: 0;
  width: 100%;
}
.wo-vendor-rate-popup-total-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
}
.wo-vendor-rate-popup-total-hint {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}
.wo-vendor-rate-popup-total strong {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #0f172a;
}
.wo-vendor-rate-popup-history,
.wo-vendor-rate-popup-add {
  width: 100%;
  box-sizing: border-box;
}
.wo-vendor-rate-popup-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 0 2px;
}
.wo-vendor-rate-popup-section-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.wo-vendor-rate-popup-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.wo-vendor-rate-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
}
.wo-vendor-rate-history-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.wo-vendor-rate-history-item.is-pending {
  border-color: #fde68a;
  background: #fffbeb;
}
.wo-vendor-rate-history-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 800;
}
.wo-vendor-rate-history-main {
  min-width: 0;
  flex: 1;
}
.wo-vendor-rate-history-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wo-vendor-rate-history-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.wo-vendor-rate-history-item strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wo-vendor-rate-history-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wo-vendor-rate-history-badge.is-initial {
  background: #e0f2fe;
  color: #0369a1;
}
.wo-vendor-rate-history-badge.is-uplift {
  background: #dcfce7;
  color: #15803d;
}
.wo-proposal-calculations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.wo-proposal-calc-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8fafc;
}
.wo-proposal-calc-card.is-benefit {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.wo-proposal-calc-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}
.wo-proposal-calc-card strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}
.wo-proposal-calc-card strong.is-negative {
  color: #b91c1c;
}
.wo-proposal-calc-hint {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
@media (max-width: 720px) {
  .wo-proposal-calculations-grid {
    grid-template-columns: 1fr;
  }
}
.wo-vendor-rate-history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}
.wo-vendor-rate-history-meta.is-edited {
  color: #475569;
}
.wo-vendor-rate-history-meta time {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.wo-vendor-rate-history-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
}
.wo-vendor-rate-history-index {
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}
.wo-vendor-rate-history-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wo-vendor-rate-history-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.wo-vendor-rate-history-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}
.wo-vendor-rate-history-empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 18px;
  font-weight: 800;
}
.wo-vendor-rate-history-empty strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
}
.wo-vendor-rate-history-empty p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}
.wo-vendor-rate-popup-add-card {
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  box-sizing: border-box;
}
.wo-vendor-rate-popup-add-card .field-label {
  margin-bottom: 10px;
}
.wo-vendor-rate-popup-input input {
  min-height: 44px;
  font-size: 16px;
  font-weight: 700;
}
.wo-vendor-rate-popup-add-note {
  margin: 12px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}
.wo-vendor-rate-popup-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid #eef2f7;
  background: #fcfdff;
}
.field-hint {
  font-weight: 500;
  color: #94a3b8;
  font-size: 12px;
}
@media (max-width: 640px) {
  .wo-proposal-summary-grid { grid-template-columns: 1fr; }
}

.wo-comments-modal .modal-form-body {
  max-height: min(70vh, 640px);
  overflow-y: auto;
}
#woCommentsOverlay {
  z-index: 110;
}
#woCommentsModal {
  z-index: 111;
}
.wo-comments-panel {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  min-width: 0;
}
.wo-comments-color-bar {
  flex-shrink: 0;
}
.wo-comments-panel--view {
  flex: 1;
  min-width: min(420px, 34vw);
  border-radius: 0 24px 24px 0;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  max-height: min(92vh, 820px);
}
.wo-comments-panel--edit {
  width: min(520px, 44vw);
  border-right: none;
  border-radius: 0;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.08);
  height: 100vh;
}
.wo-comments-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.wo-comments-panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.wo-comments-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  min-height: 0;
}
.wo-comments-panel-foot {
  flex-shrink: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
}
.wo-comments-panel-close {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #64748b !important;
  box-shadow: none !important;
}
.wo-drawer-comments-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}
.wo-comments-panel--edit.hidden + .workorder-drawer {
  box-shadow: -8px 0 32px rgba(15,23,42,.12);
}
@media (max-width: 1100px) {
  .wo-view-stage {
    left: 8px;
    right: 8px;
    flex-direction: column;
    max-height: 96vh;
    overflow-y: auto;
  }
  .wo-view-modal {
    width: 100%;
    border-radius: 24px 24px 0 0;
    border-right: 1px solid #e5e7eb;
    max-height: none;
  }
  .wo-comments-panel--view {
    min-width: 0;
    width: 100%;
    border-radius: 0 0 24px 24px;
    max-height: 42vh;
  }
  .wo-drawer-stage {
    flex-direction: column-reverse;
    width: 100vw;
    height: 100vh;
  }
  .wo-comments-panel--edit {
    width: 100%;
    height: min(46vh, 420px);
    border-top: 1px solid #e5e7eb;
  }
  .workorder-drawer {
    width: 100vw;
    height: auto;
    flex: 1;
    min-height: 0;
  }
}
.wo-comments-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}
.wo-comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.wo-comments-empty,
.wo-comments-error {
  margin: 0;
  padding: 20px 16px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
  font-size: 14px;
}
.wo-comments-error {
  background: #fef2f2;
  color: #b91c1c;
}
.wo-comment-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.wo-comment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.wo-comment-card.is-editing {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.wo-comment-author-wrap {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.wo-comment-author {
  font-size: 14px;
  color: #0f172a;
  white-space: nowrap;
}
.wo-comment-role {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}
.wo-comment-role--admin {
  background: #dbeafe;
  color: #1d4ed8;
}
.wo-comment-role--technician {
  background: #dcfce7;
  color: #15803d;
}
.wo-comment-role--user {
  background: #f1f5f9;
  color: #64748b;
}
.wo-comment-time {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}
.wo-comment-head-end {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.wo-comment-meta-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wo-comment-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wo-comment-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.wo-comment-action-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wo-comment-action-btn:hover {
  transform: translateY(-1px);
}
.wo-comment-action-btn--edit {
  color: #2563eb;
  border-color: #bfdbfe;
  background: #f8fbff;
}
.wo-comment-action-btn--edit:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.wo-comment-action-btn--delete {
  color: #dc2626;
  border-color: #fecaca;
  background: #fffbfb;
}
.wo-comment-action-btn--delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}
.wo-comment-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wo-comment-edit-input {
  width: 100%;
  min-height: 88px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.wo-comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.wo-comment-edit-attachments,
.wo-comment-edit-new-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wo-comment-edit-attachment,
.wo-comment-edit-new-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 8px 6px 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 600;
}
.wo-comment-edit-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.wo-comment-edit-attachment-remove,
.wo-comment-edit-new-file button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.wo-comment-edit-attach {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  background: #f8fbff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.wo-comment-edit-attach svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.communication-message-head-end {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.communication-message-author {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.communication-message.is-editing {
  background: #f8fbff;
  cursor: default;
}
.communication-message-content .communication-message-body {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 0;
  color: #334155;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.communication-message-content header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.communication-thread-message {
  padding: 15px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.4);
}
.communication-thread-message .wo-comment-card-head {
  margin-bottom: 8px;
}
.communication-thread-message .wo-comment-card-head > .wo-comment-author-wrap,
.communication-thread-message .wo-comment-card-head > .wo-comment-head-end {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.communication-thread-message .wo-comment-author-wrap {
  flex-wrap: nowrap;
}
.communication-thread-message .wo-comment-body {
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}
.wo-comment-body {
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}
.wo-comments-compose {
  margin-top: 4px;
}
.wo-comments-compose-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.wo-comments-attachment-preview {
  margin-top: 10px;
}
.wo-comment-files {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.billing-tabs {
  display: none;
}
.billing-cost-hint {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
}
.billing-cost-hint.is-warning {
  background: #fff7ed;
  color: #c2410c;
}
.billing-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.wo-finance-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.wo-finance-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
}
.wo-finance-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.wo-finance-section .wo-proposal-summary {
  min-height: 0;
}
.wo-finance-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.wo-finance-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wo-finance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .wo-finance-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.wo-finance-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}
.wo-finance-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.wo-finance-card-head strong {
  font-size: 13px;
  color: #0f172a;
}
.wo-finance-locked-wo .entity-field:has(#woProposalWorkOrderSelect),
.wo-finance-locked-wo .entity-field:has(#vendorBillingWorkOrderSelect),
.wo-finance-locked-wo .entity-field:has(#amazonBillingWorkOrderSelect) {
  display: none;
}
.billing-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}
.billing-status--paid,
.billing-status--accepted,
.billing-status--invoiced {
  background: #dcfce7;
  color: #15803d;
}
.billing-status--pending {
  background: #fef9c3;
  color: #a16207;
}
.billing-status--cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.billing-print-logo-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Chart of Accounts */
.coa-type-filter { width: 190px; flex-shrink: 0; }
.coa-type-filter .wo-ss-trigger {
  border-radius: 16px;
  padding: 14px 40px 14px 16px;
  font-size: 14px;
  font-weight: 700;
}
.coa-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #0f172a;
}
.coa-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.coa-name-cell strong { font-size: 14px; color: #0f172a; }
.coa-name-cell small { color: #64748b; font-size: 12px; }
.coa-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}
.coa-type-badge--bank { background: #dbeafe; color: #1d4ed8; }
.coa-type-badge--receivable { background: #dcfce7; color: #15803d; }
.coa-type-badge--payable { background: #ffedd5; color: #c2410c; }
.coa-type-badge--liability { background: #fee2e2; color: #b91c1c; }
.coa-type-badge--expense { background: #fce7f3; color: #be185d; }
.coa-type-badge--inventory { background: #ede9fe; color: #6d28d9; }
.coa-type-badge--asset { background: #e0f2fe; color: #0369a1; }
.coa-type-badge--income { background: #ecfccb; color: #4d7c0f; }
.coa-type-badge--equity { background: #f1f5f9; color: #334155; }
.coa-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}
.coa-switch input { width: 18px; height: 18px; }

/* =====================================================
   Top navigation bar (replaces the left sidebar)
   ===================================================== */
:root { --topnav-h: 64px; }

.app-shell { flex-direction: column; min-height: 100vh; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -20px rgba(15, 23, 42, 0.25);
}
.topnav-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topnav-h);
  padding: 0 20px;
  width: 100%;
}

/* Brand */
.topnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  padding-right: 8px;
}
.topnav-logo {
  width: auto;
  height: 40px;
  border-radius: 0;
  overflow: visible;
  display: grid;
  place-items: center;
  box-shadow: none;
  background: transparent;
}
.topnav-logo img {
  width: auto;
  height: 40px;
  max-width: min(220px, 42vw);
  object-fit: contain;
  display: block;
}
.topnav-brand-copy { display: flex; flex-direction: column; line-height: 1.15; justify-content: center; }
.topnav-brand-copy strong { font-size: 16px; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; }
.topnav-brand-copy small { font-size: 10.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.1em; }

/* Menu (horizontal on desktop) */
.topnav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.topnav-menu-head { display: none; }

.topnav-menu > .nav-link,
.topnav-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.topnav-menu > .nav-link .nav-svg,
.topnav-group-btn > .nav-svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.topnav-menu > .nav-link:hover,
.topnav-group-btn:hover { background: #f1f5f9; color: #0f172a; }
.topnav-menu > .nav-link.active,
.topnav-group-btn.active { background: #eff6ff; color: #2563eb; }

.nav-link--emails {
  position: relative;
  align-items: center;
  padding-top: 7px;
  padding-bottom: 7px;
  padding-right: 10px;
  overflow: visible;
}
.nav-link--communication {
  position: relative;
  align-items: center;
  padding-top: 7px;
  padding-bottom: 7px;
  padding-right: 10px;
  overflow: visible;
}
.nav-link--emails .nav-link-label {
  line-height: 1.15;
  transform: translateY(-1px);
}
.nav-link--communication .nav-link-label {
  line-height: 1.15;
  transform: translateY(-1px);
}
.nav-link-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(220, 38, 38, 0.5);
  z-index: 2;
}
.nav-link--emails.has-unread-badge,
.nav-link--communication.has-unread-badge {
  padding-right: 34px;
}
.nav-link-badge.hidden {
  display: none;
}
.nav-link-badge.is-pulse {
  animation: emails-badge-pulse 0.85s ease;
}
@keyframes emails-badge-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.topnav-caret {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.topnav-group-btn:hover .topnav-caret,
.topnav-group-btn.active .topnav-caret { color: currentColor; }

/* Dropdowns */
.topnav-item { position: relative; }
.topnav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 224px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 40px -14px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 8px;
  display: none;
  z-index: 70;
}
.topnav-item.open > .topnav-dropdown { display: block; }
.topnav-item.open > .topnav-group-btn { background: #f1f5f9; color: #0f172a; }
.topnav-item.open > .topnav-group-btn .topnav-caret,
.topnav-item:hover > .topnav-group-btn .topnav-caret { transform: rotate(180deg); }

/* Hover bridge so the dropdown doesn't close crossing the gap */
.topnav-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.topnav-dropdown .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}
.topnav-dropdown .nav-link .nav-svg {
  width: 16px;
  height: 16px;
  stroke: #94a3b8;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.topnav-dropdown .nav-link:hover { background: #f8fafc; color: #0f172a; }
.topnav-dropdown .nav-link.active { background: #eff6ff; color: #2563eb; }
.topnav-dropdown .nav-link.active .nav-svg,
.topnav-dropdown .nav-link:hover .nav-svg { stroke: currentColor; }

/* Nested flyout submenu */
.topnav-subitem { position: relative; }
.topnav-sub-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
}
.topnav-sub-btn > .nav-svg {
  width: 16px;
  height: 16px;
  stroke: #94a3b8;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.topnav-sub-btn .topnav-caret { margin-left: auto; }
.topnav-sub-btn:hover { background: #f8fafc; color: #0f172a; }
.topnav-sub-btn.active { background: #eff6ff; color: #2563eb; }
.topnav-subdropdown {
  position: absolute;
  top: -8px;
  left: calc(100% + 2px);
  min-width: 208px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 40px -14px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 8px;
  display: none;
  z-index: 80;
}
.topnav-subdropdown::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10px;
  width: 10px;
}
.topnav-subitem.open > .topnav-subdropdown { display: block; }
.topnav-subdropdown-scroll {
  max-height: min(70vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Hover-open on devices with a pointer (desktop horizontal nav) */
@media (hover: hover) and (min-width: 1400px) {
  .topnav-item:hover > .topnav-dropdown { display: block; }
  .topnav-item:hover > .topnav-group-btn { background: #f1f5f9; color: #0f172a; }
  .topnav-item:hover > .topnav-group-btn.active { background: #eff6ff; color: #2563eb; }
  .topnav-subitem:hover > .topnav-subdropdown { display: block; }
  .topnav-subitem:hover > .topnav-sub-btn { background: #f8fafc; color: #0f172a; }
}

/* Right side: profile + sign out */
.topnav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.topnav-profile {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.topnav-profile:hover {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.topnav-profile .profile-avatar-shell {
  width: 34px;
  height: 34px;
  border-radius: 999px;
}
.topnav-profile-copy { text-align: left; line-height: 1.2; min-width: 0; }
.topnav-profile-copy p { margin: 0; }
.topnav-profile-copy p:first-child {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topnav-profile-copy p:last-child { font-size: 11px; font-weight: 600; color: #94a3b8; }
.topnav-logout {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.topnav-logout svg { width: 19px; height: 19px; }
.topnav-logout:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

/* Burger (hidden on desktop) */
.topnav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.topnav-burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #334155;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.topnav-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topnav-burger.is-open span:nth-child(2) { opacity: 0; }
.topnav-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.topnav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}
.topnav-backdrop.hidden { display: none; }

/* Main content under the top bar — page shells scroll inside cards/panels */
.app-main {
  margin-left: 0;
  width: 100%;
  padding: 24px;
  height: calc(100vh - var(--topnav-h));
  max-height: calc(100vh - var(--topnav-h));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  transition: none;
}
.app-shell.sidebar-collapsed .app-main { margin-left: 0; width: 100%; padding-left: 24px; }

.app-main > .crud-page,
.app-main > .communication-page,
.app-main > .dashboard-page,
.app-main > .calendar-page,
.app-main > .tracking-page,
.app-main > .wo-show-page {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.access-list-panel {
  flex: 1;
  min-height: 0;
  max-height: none;
}

/* Compact / tablet / zoomed: menu becomes a slide-in drawer with accordions */
@media (max-width: 1399.98px) {
  .topnav-inner { padding: 0 14px; gap: 8px; }
  .topnav-burger { display: flex; }
  .topnav-profile-copy { display: none; }
  .topnav-profile { padding: 4px; border-radius: 999px; }

  .topnav-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 90;
    width: min(320px, 86vw);
    background: #fff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 0 0 60px rgba(15, 23, 42, 0.25);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .topnav-menu.open { transform: translateX(0); }

  .topnav-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
  }
  .topnav-menu-head span {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
  }
  .topnav-menu-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
  }
  .topnav-menu-close svg { width: 16px; height: 16px; }

  .topnav-menu > .nav-link,
  .topnav-group-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 14px;
  }
  .topnav-group-btn .topnav-caret { margin-left: auto; }

  /* Dropdowns become inline accordions */
  .topnav-dropdown,
  .topnav-subdropdown {
    position: static;
    min-width: 0;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 2px 0 6px 14px;
    margin-left: 14px;
    border-left: 2px solid #eef2f7;
  }
  .topnav-dropdown::before,
  .topnav-subdropdown::before { display: none; }
  .topnav-item.open > .topnav-group-btn .topnav-caret { transform: rotate(180deg); }
  .topnav-subitem.open > .topnav-sub-btn .topnav-caret { transform: rotate(90deg); }

  body.topnav-menu-open { overflow: hidden; }

  .app-main { padding: 14px; padding-top: 14px; padding-left: 14px; }
}

/* Wide desktop: keep horizontal nav compact enough to avoid crowding */
@media (min-width: 1400px) and (max-width: 1599.98px) {
  .topnav-brand-copy small { display: none; }
  .topnav-profile-copy p:last-child { display: none; }
  .topnav-menu > .nav-link,
  .topnav-group-btn { padding: 9px 10px; font-size: 13px; gap: 6px; }
  .topnav-inner { gap: 6px; padding: 0 16px; }
}

/* Communication inbox */
.communication-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
.communication-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 10%, rgba(99, 102, 241, 0.13), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef2ff 100%);
  box-shadow: 0 16px 38px -28px rgba(30, 64, 175, 0.45);
  flex-shrink: 0;
}
.communication-eyebrow {
  display: inline-flex;
  margin-bottom: 7px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.communication-hero h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 850;
  letter-spacing: -0.04em;
}
.communication-hero p {
  margin: 7px 0 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
}
.communication-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  padding: 0 14px;
  border: 1px solid #dbe3ef;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px -16px rgba(15, 23, 42, 0.35);
}
.communication-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
}
.communication-search input {
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
}
.communication-panel {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 45px -36px rgba(15, 23, 42, 0.5);
}
.communication-page-loader {
  z-index: 6;
  background: #fff;
  backdrop-filter: none;
  border-radius: inherit;
}
.communication-panel.is-loading > :not(.communication-page-loader):not(#communicationError) {
  visibility: hidden;
  pointer-events: none;
}
.communication-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #fbfdff;
  flex-shrink: 0;
}
.communication-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}
.communication-filter span {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  text-align: center;
}
.communication-filter:hover { background: #f1f5f9; color: #0f172a; }
.communication-filter.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.communication-filter.active span { background: #2563eb; color: #fff; }
.communication-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.communication-panel .wo-list-toolbar,
.communication-panel .wo-list-pagination {
  flex-shrink: 0;
}
.communication-panel #communicationError {
  flex-shrink: 0;
  margin: 0;
  border-radius: 0;
}
.communication-message {
  position: relative;
  display: grid;
  grid-template-columns: 4px 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.communication-message:last-child { border-bottom: 0; }
.communication-message:hover,
.communication-message:focus-visible {
  z-index: 1;
  outline: none;
  background: #f8fbff;
}
.communication-message--unread .communication-message-author strong,
.communication-message--unread .communication-message-body {
  font-weight: 800;
  color: #0f172a;
}
.communication-message--unread .communication-message-accent {
  background: #2563eb;
}
.communication-message-accent {
  align-self: stretch;
  min-height: 58px;
  border-radius: 999px;
  background: linear-gradient(#2563eb, #06b6d4);
}
.communication-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 850;
}
.communication-message-content { min-width: 0; }
.communication-message-content header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.communication-message-content header > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.communication-message-content strong { color: #0f172a; font-size: 13px; }
.communication-message-content time {
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}
.communication-message-content > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 0;
  color: #334155;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.communication-type {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.communication-type.reactive { background: #dbeafe; color: #1d4ed8; }
.communication-type.preventive { background: #dcfce7; color: #15803d; }
.communication-file-count {
  margin-top: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.communication-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  padding: 8px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
}
.communication-reply-btn:hover { background: #eff6ff; }
.communication-reply-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.communication-loader,
.communication-empty-state {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 220px;
  padding: 40px;
  color: #94a3b8;
  text-align: center;
  flex-shrink: 0;
}
.communication-loader.hidden,
.communication-page-loader.hidden { display: none; }
.communication-empty-state p { margin: 0; font-size: 13px; }
.communication-empty-state span { font-size: 34px; }
.communication-empty-state h3 { margin: 4px 0 0; color: #334155; font-size: 16px; }

.wo-comments-orbit-loader {
  position: relative;
  inset: auto;
  min-height: 220px;
  background: #fff;
  backdrop-filter: none;
  border-radius: 12px;
}
.is-loading-comments {
  position: relative;
  min-height: 220px;
}

/* Communication conversation drawer */
.communication-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 84;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}
.communication-drawer-overlay.hidden { display: none; }
.communication-drawer {
  position: fixed;
  top: var(--topnav-h);
  right: 0;
  bottom: 0;
  z-index: 85;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, 100vw);
  border-left: 1px solid #dbe3ef;
  background: #f8fafc;
  box-shadow: -24px 0 60px -30px rgba(15, 23, 42, 0.55);
  transform: translateX(105%);
  transition: transform 0.25s ease;
}
.communication-drawer.open { transform: translateX(0); }
.communication-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.communication-drawer-kicker {
  color: #2563eb;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.communication-drawer-head h2 {
  margin: 4px 0 7px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.02em;
}
.communication-drawer-title-link {
  color: inherit;
  text-decoration: none;
  word-break: break-word;
}
.communication-drawer-title-link:hover,
.communication-drawer-title-link:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  outline: none;
}
.communication-drawer-meta { display: flex; gap: 7px; }
.communication-drawer-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.communication-thread {
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
  padding: 22px;
}
.communication-thread-message {
  padding: 15px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.4);
}
.communication-thread-message header.wo-comment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.communication-thread-message header:not(.wo-comment-card-head) {
  display: flex;
  align-items: center;
  gap: 10px;
}
.communication-thread-message .communication-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
}
.communication-thread-message header:not(.wo-comment-card-head) > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.communication-thread-message strong { color: #0f172a; font-size: 12px; }
.communication-thread-message time { color: #94a3b8; font-size: 10px; font-weight: 600; }
.communication-thread-message > p {
  margin: 12px 0 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.65;
}
.communication-files {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.communication-file-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #eff6ff;
  overflow: hidden;
}
.communication-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}
.communication-file-chip .communication-file {
  border-radius: 0;
}
.communication-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.communication-file svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.communication-file-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  border: 0;
  border-left: 1px solid #dbeafe;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
}
.communication-file-download:hover,
.communication-file:hover {
  background: #dbeafe;
}
.communication-file-download svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.communication-composer {
  padding: 16px 18px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.communication-composer textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
}
.communication-composer textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.communication-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.communication-attach-btn,
.communication-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}
.communication-attach-btn { color: #2563eb; }
.communication-attach-btn svg,
.communication-send-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.communication-send-btn {
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
}
.communication-send-btn:hover { background: #1d4ed8; }
.communication-send-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.communication-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}
.communication-attachment-preview.hidden { display: none; }
.communication-attachment-preview span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
}
.communication-attachment-preview button {
  border: 0;
  background: none;
  color: #64748b;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.communication-empty {
  margin: auto;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}
body.communication-drawer-open { overflow: hidden; }

@media (max-width: 720px) {
  .communication-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 22px 20px;
  }
  .communication-search { width: 100%; }
  .communication-tabs {
    overflow-x: auto;
    padding: 12px;
  }
  .communication-filter { flex-shrink: 0; }
  .communication-message {
    grid-template-columns: 4px 36px minmax(0, 1fr);
    gap: 10px;
    padding: 16px 14px;
  }
  .communication-message .communication-avatar { width: 34px; height: 34px; }
  .communication-message-content header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .communication-reply-btn {
    grid-column: 3;
    justify-self: start;
    margin-top: 4px;
  }
  .communication-drawer {
    top: 0;
    width: 100vw;
  }
}

/* Tracking — viewport-fit layout (must win over generic .app-main rules) */
body[data-page="tracking"] .app-main {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topnav-h));
  max-height: calc(100vh - var(--topnav-h));
  overflow: hidden;
  box-sizing: border-box;
}

body[data-page="tracking"] .tracking-page {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
}

body[data-page="tracking"] .tracking-layout {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
}

body[data-page="tracking"] .tracking-map-panel,
body[data-page="tracking"] .tracking-employees-panel {
  height: 100%;
  max-height: 100%;
}
body[data-page="tracking"] .tracking-employees-body {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  overflow-y: auto;
}


/* Vendor Map module — viewport fit */
body[data-page="vendor-map"] .app-main {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topnav-h, 72px));
  max-height: calc(100vh - var(--topnav-h, 72px));
  overflow: hidden;
  box-sizing: border-box;
  padding-bottom: 16px;
}

body[data-page="vendor-map"] .vendors-map-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  gap: 12px;
  overflow: hidden;
}

body[data-page="vendor-map"] .vendor-map-hero {
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 16px 20px;
  margin-bottom: 0;
  border-radius: 22px;
}

body[data-page="vendor-map"] .vendor-map-hero-copy {
  flex: 1 1 auto;
  min-width: 180px;
  max-width: 34%;
}

body[data-page="vendor-map"] .vendor-map-hero-copy h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

body[data-page="vendor-map"] .vendor-map-hero-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
}

body[data-page="vendor-map"] .vendor-map-hero-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 1 auto;
  margin-left: auto;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 16px;
  max-width: none;
}

.vendor-map-toolbar-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 0 0 auto;
}

.vendor-map-location-field {
  width: min(320px, 36vw);
  min-width: 240px;
  flex: 1 1 280px;
}

.vendor-map-trade-field {
  width: 190px;
  min-width: 160px;
  flex: 0 0 190px;
}

.vendor-map-radius-field {
  width: 140px;
  min-width: 120px;
  flex: 0 0 140px;
}

.vendor-map-area-field {
  width: min(240px, 28vw);
  min-width: 200px;
  flex: 1 1 220px;
}

.vendor-map-area-search-wrap {
  position: relative;
  width: 100%;
}

.vendor-map-area-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.55;
}

.vendor-map-area-search-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 14px 0 36px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
}

.vendor-map-area-search-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.vendor-map-area-search-input:hover {
  border-color: #cbd5e1;
}

.vendor-map-area-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.vendor-map-list-section-label {
  margin: 12px 0 8px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.vendor-map-list-section-label:first-child {
  margin-top: 0;
}

.vendor-map-list-card.is-site-card .vendor-map-list-icon {
  background: #eff6ff;
}

.vendor-map-filter-label {
  display: block;
  margin: 0 0 6px;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.2;
  white-space: nowrap;
}

.vendor-map-filter-label--spacer {
  visibility: hidden;
  user-select: none;
}

body[data-page="vendor-map"] .vendor-map-location-field .wo-search-select,
body[data-page="vendor-map"] .vendor-map-location-field .wo-ss-root,
body[data-page="vendor-map"] .vendor-map-trade-field .wo-search-select,
body[data-page="vendor-map"] .vendor-map-trade-field .wo-ss-root,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-search-select,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-ss-root {
  width: 100%;
}

/* Match calendar toolbar controls: same height, no text clipping */
body[data-page="vendor-map"] .vendor-map-location-field .wo-ss-trigger,
body[data-page="vendor-map"] .vendor-map-trade-field .wo-ss-trigger,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-ss-trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 36px 0 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
}

body[data-page="vendor-map"] .vendor-map-location-field .wo-ss-trigger.placeholder,
body[data-page="vendor-map"] .vendor-map-trade-field .wo-ss-trigger.placeholder,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-ss-trigger.placeholder {
  color: #94a3b8;
  font-weight: 500;
}

body[data-page="vendor-map"] .vendor-map-location-field .wo-ss-trigger:hover,
body[data-page="vendor-map"] .vendor-map-trade-field .wo-ss-trigger:hover,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-ss-trigger:hover {
  border-color: #cbd5e1;
}

body[data-page="vendor-map"] .vendor-map-location-field .wo-search-select.open .wo-ss-trigger,
body[data-page="vendor-map"] .vendor-map-location-field .wo-ss-root.open .wo-ss-trigger,
body[data-page="vendor-map"] .vendor-map-trade-field .wo-search-select.open .wo-ss-trigger,
body[data-page="vendor-map"] .vendor-map-trade-field .wo-ss-root.open .wo-ss-trigger,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-search-select.open .wo-ss-trigger,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-ss-root.open .wo-ss-trigger {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

body[data-page="vendor-map"] .vendor-map-location-field .wo-ss-trigger::after,
body[data-page="vendor-map"] .vendor-map-trade-field .wo-ss-trigger::after,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-ss-trigger::after {
  right: 14px;
  border-top-color: #64748b;
}

body[data-page="vendor-map"] .vendor-map-trade-field .wo-ss-dropdown,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-ss-dropdown {
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  z-index: 90;
}

body[data-page="vendor-map"] .vendor-map-trade-field .wo-ss-option,
body[data-page="vendor-map"] .vendor-map-radius-field .wo-ss-option {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
}

.vendor-map-toolbar-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.vendor-map-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  min-height: 44px;
  height: 44px;
  padding: 0 14px;
  white-space: nowrap;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.vendor-map-clear-btn:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #0f172a;
}

.vendor-map-clear-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  overflow: visible;
}

body[data-page="vendor-map"] .vendor-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 12px;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body[data-page="vendor-map"] .vendor-map-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  background: #eef2f7;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body[data-page="vendor-map"] .vendor-map-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.vendor-map-missing-key {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}

.vendor-map-stage .page-orbit-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
}

.vendor-map-stage .page-orbit-loader.hidden {
  display: none;
}

.vendor-map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.vendor-map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vendor-map-legend-pin {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

.vendor-map-legend-pin--site { background: #2563eb; }
.vendor-map-legend-pin--selected { background: #ef4444; }
.vendor-map-legend-pin--vendor { background: #0ea5e9; }

body[data-page="vendor-map"] .vendor-map-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: none;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.vendor-map-sidebar-head {
  flex-shrink: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.vendor-map-sidebar-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.vendor-map-sidebar-meta {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.vendor-map-site-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 12px;
  background: #f1f5f9;
}

.vendor-map-site-tabs.hidden {
  display: none;
}

.vendor-map-site-tab {
  appearance: none;
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}

.vendor-map-site-tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.55);
}

.vendor-map-site-tab.is-active {
  color: #1d4ed8;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body[data-page="vendor-map"] .vendor-map-vendor-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vendor-map-list-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 16px;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}

.vendor-map-list-card:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.vendor-map-list-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #dbeafe;
  font-size: 18px;
}

.vendor-map-list-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vendor-map-list-body strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-map-list-body span {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-map-list-chevron {
  color: #94a3b8;
  font-size: 20px;
  font-weight: 700;
}

.vendor-map-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.vendor-map-status.is-linked {
  background: #dcfce7;
  color: #166534;
}

.vendor-map-status.is-nearby {
  background: #dbeafe;
  color: #1d4ed8;
}

.vendor-map-status.is-all {
  background: #f1f5f9;
  color: #475569;
}

.vendor-map-status.is-muted {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.vendor-map-list-card.is-no-address {
  opacity: 0.88;
}

.vendor-map-list-pane {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vendor-map-list-pane.hidden {
  display: none !important;
}

.vendor-map-list-icon--wo {
  background: #e0e7ff;
}

.vendor-map-order-detail {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 14px 16px;
}

.vendor-map-order-detail.hidden {
  display: none !important;
}

.vendor-map-order-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0 10px;
}

.vendor-map-order-back:hover {
  text-decoration: underline;
}

.vendor-map-order-detail-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}

.vendor-map-order-hero {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  padding: 12px 14px;
}

.vendor-map-order-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}

.vendor-map-order-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.vendor-map-order-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vendor-map-order-vendor {
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  background: #ecfdf5;
  padding: 12px 14px;
}

.vendor-map-order-section-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.vendor-map-order-vendor .vendor-map-order-section-label {
  color: #047857;
}

.vendor-map-order-vendor-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #065f46;
  word-break: break-word;
}

.vendor-map-order-meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}

.vendor-map-order-meta div {
  min-width: 0;
}

.vendor-map-order-meta dt {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.vendor-map-order-meta dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.vendor-map-order-block {
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
}

.vendor-map-order-block p:last-child {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

.vendor-map-order-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.vendor-map-order-open {
  text-align: center;
  text-decoration: none;
}

.vendor-map-empty {
  margin: 0;
  padding: 18px 16px 22px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  flex-shrink: 0;
}

.vendor-map-infocard {
  max-width: 280px;
  padding: 4px 2px;
  font-family: inherit;
}

.vendor-map-infocard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.vendor-map-infocard-top strong {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.vendor-map-infocard-address {
  margin: 0 0 10px;
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
}

.vendor-map-infocard-meta {
  margin: 0;
  display: grid;
  gap: 6px;
}

.vendor-map-infocard-meta > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 6px;
  font-size: 12px;
}

.vendor-map-infocard-meta dt {
  margin: 0;
  color: #94a3b8;
  font-weight: 700;
}

.vendor-map-infocard-meta dd {
  margin: 0;
  color: #0f172a;
  font-weight: 600;
  word-break: break-word;
}

.gm-style .gm-style-iw-c {
  border-radius: 14px !important;
  padding: 10px 12px !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14) !important;
}

@media (max-width: 1100px) {
  body[data-page="vendor-map"] .vendor-map-hero {
    flex-wrap: wrap;
    align-items: stretch;
  }

  body[data-page="vendor-map"] .vendor-map-hero-copy {
    max-width: none;
    flex: 1 1 100%;
  }

  body[data-page="vendor-map"] .vendor-map-hero-filters {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: 0;
  }

  .vendor-map-location-field {
    flex: 1 1 220px;
    width: auto;
    min-width: 200px;
  }

  .vendor-map-trade-field {
    flex: 0 1 160px;
    width: auto;
  }

  .vendor-map-radius-field {
    flex: 0 1 130px;
    width: auto;
  }
}

@media (max-width: 640px) {
  body[data-page="vendor-map"] .vendor-map-hero-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .vendor-map-location-field,
  .vendor-map-trade-field,
  .vendor-map-radius-field,
  .vendor-map-area-field {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .vendor-map-toolbar-actions {
    width: 100%;
  }

  .vendor-map-clear-btn {
    width: 100%;
  }
}

@media (max-width: 980px) {
  body[data-page="vendor-map"] .app-main {
    height: auto;
    max-height: none;
    overflow: auto;
  }

  body[data-page="vendor-map"] .vendors-map-page {
    height: auto;
    overflow: visible;
  }

  body[data-page="vendor-map"] .vendor-map-layout {
    grid-template-columns: 1fr;
    height: auto;
    flex: none;
    overflow: visible;
  }

  body[data-page="vendor-map"] .vendor-map-stage,
  body[data-page="vendor-map"] .vendor-map-canvas {
    min-height: 50vh;
    height: 50vh;
  }

  body[data-page="vendor-map"] .vendor-map-sidebar {
    height: auto;
    max-height: 45vh;
  }
}

/* ============================================================
   Emails Page
   ============================================================ */
.emails-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  height: calc(100vh - 92px);
  width: 100%;
  overflow: hidden;
}
.emails-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  align-items: start;
  gap: 20px 28px;
  padding: 20px 24px;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 10%, rgba(99, 102, 241, 0.13), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef2ff 100%);
  box-shadow: 0 16px 38px -28px rgba(30, 64, 175, 0.45);
  flex-shrink: 0;
}
.emails-hero-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.emails-hero-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}
.emails-hero h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.emails-hero p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.emails-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.emails-account-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.emails-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px -20px rgba(30, 64, 175, 0.55);
}
.emails-account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.emails-account-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 100%);
  color: #1d4ed8;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.emails-account-chip-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.emails-account-chip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.emails-account-chip-label {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.emails-account-email {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.emails-sync-btn.is-syncing .emails-action-icon svg {
  animation: emails-sync-spin 0.85s linear infinite;
}
@keyframes emails-sync-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.emails-sync-progress {
  position: relative;
  height: 3px;
  background: #e8edf5;
  flex-shrink: 0;
  overflow: hidden;
}
.emails-sync-progress.hidden {
  display: none;
}
.emails-sync-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
  transition: width 0.2s linear;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.45);
  will-change: width;
}
.emails-sync-btn,
.emails-compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.emails-sync-btn:active,
.emails-compose-btn:active {
  transform: translateY(1px);
}
.emails-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
}
.emails-sync-btn .emails-action-icon {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}
.emails-compose-btn .emails-action-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.emails-action-icon svg,
.emails-compose-btn > svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.emails-sync-btn {
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: #fff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  box-shadow: 0 8px 18px -14px rgba(30, 64, 175, 0.55);
}
.emails-sync-btn:hover {
  background: #eff6ff;
  box-shadow: 0 10px 22px -14px rgba(30, 64, 175, 0.65);
}
.emails-compose-btn {
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 12px 24px -14px rgba(37, 99, 235, 0.95);
}
.emails-compose-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}
.emails-inbox {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1;
}
.emails-boot-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  background: #fff;
}
.emails-boot-section.hidden {
  display: none;
}
.emails-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 18px -10px rgba(15, 23, 42, 0.12);
}
.emails-folders {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  margin-top: 2px;
  width: fit-content;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #dbeafe;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.emails-folders.hidden {
  display: none;
}
.emails-folder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 100px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.emails-folder svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.emails-folder:hover {
  background: #eef2f7;
}
.emails-folder.active {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1d4ed8;
  box-shadow: 0 6px 14px -12px rgba(37, 99, 235, 0.75);
}
.emails-folder-count {
  margin-left: auto;
  min-width: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}
.emails-folder-count.hidden {
  display: none;
}
.emails-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.35);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.emails-search:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}
.emails-search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}
.emails-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 0;
  font-size: 14px;
  color: #0f172a;
}
.emails-search input::placeholder {
  color: #94a3b8;
}
.emails-layout {
  display: flex;
  gap: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.emails-list-column {
  width: 420px;
  min-width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #e8edf5;
}
.emails-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #e8edf5;
  background: #f8fafc;
  flex-shrink: 0;
}
.emails-list-count {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.emails-list-pager {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.emails-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.emails-page-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.emails-page-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}
.emails-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.emails-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: auto;
  min-width: 0;
  border-right: none;
}
.emails-empty {
  padding: 32px 20px;
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
}
.emails-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.1s;
}
.emails-item:hover {
  background: #f8fafc;
  box-shadow: inset 1px 0 0 #dbeafe;
}
.emails-item--active {
  background: #c2dbff !important;
  box-shadow: inset 4px 0 0 #2563eb;
}
.emails-item--unread .emails-item-from,
.emails-item--unread .emails-item-subject,
.emails-item--unread .emails-item-snippet {
  font-weight: 700;
  color: #0f172a;
}
.emails-item--unread .emails-item-time {
  font-weight: 800;
  color: #1d4ed8;
}
.emails-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}
.emails-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.emails-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.emails-avatar-wrap .emails-avatar--fallback {
  position: absolute;
  inset: 0;
}
.emails-avatar-wrap img.emails-avatar {
  position: relative;
  z-index: 1;
}
.emails-item-body {
  min-width: 0;
  flex: 1;
}
.emails-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.emails-item-from {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emails-item-preview {
  display: flex;
  min-width: 0;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emails-item-subject {
  flex-shrink: 0;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #334155;
}
.emails-item-snippet {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #94a3b8;
  font-weight: 400;
}
.emails-item-time {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  flex-shrink: 0;
}
/* Thread panel */
.emails-thread-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
}
.emails-thread-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
  color: #64748b;
}
.emails-thread-empty.hidden {
  display: none;
}
.emails-thread-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.emails-thread-empty-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #2563eb;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.emails-thread-empty h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.emails-thread-empty p {
  margin: 0;
  font-size: 14px;
  max-width: 280px;
}
.emails-thread-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.emails-thread-content.hidden {
  display: none;
}
.emails-thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e8edf5;
  flex-shrink: 0;
}
.emails-thread-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.emails-thread-back svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #475569;
  stroke-width: 2;
  stroke-linecap: round;
}
.emails-thread-subject {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.emails-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.emails-message {
  border: 1px solid #e8edf5;
  border-radius: 12px;
  overflow: visible;
  flex-shrink: 0;
  background: #fff;
}
.emails-message--sent {
  border-color: #dbeafe;
}
.emails-message--sent .emails-message-card {
  background: #eff6ff;
}
.emails-message-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.emails-message-card:hover {
  background: #f1f5f9;
}
.emails-message.is-expanded .emails-message-card {
  border-bottom: 1px solid #e8edf5;
}
.emails-message-card .emails-message-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.emails-message-card-main {
  min-width: 0;
  flex: 1;
}
.emails-message-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.emails-message-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.emails-message-attach-icon {
  display: inline-flex;
  color: #64748b;
}
.emails-message-attach-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.emails-message-snippet {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emails-message.is-collapsed .emails-message-detail {
  display: none;
}
.emails-message.is-expanded .emails-message-snippet {
  display: none;
}
.emails-message-card .emails-message-to {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emails-message-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.emails-message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.emails-message-avatar.emails-message-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.emails-message-avatar-wrap .emails-message-avatar--fallback {
  position: absolute;
  inset: 0;
}
.emails-message-avatar-wrap img.emails-message-avatar {
  position: relative;
  z-index: 1;
}
.emails-message-from {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}
.emails-message-to {
  color: #64748b;
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emails-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e8edf5;
  font-size: 13px;
  gap: 8px;
  flex-wrap: wrap;
}
.emails-message-time {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
.emails-message-body {
  padding: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
  overflow: visible;
}
.emails-message-body img {
  max-width: 100%;
}
.emails-message-attachments {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e8edf5;
}
.emails-message-attachments-label {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.emails-message-attachments .communication-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.emails-attachment-chip {
  max-width: 100%;
}
.emails-attachment-size {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.emails-message-iframe {
  width: 100%;
  min-height: 420px;
  border: none;
  display: block;
  background: #fff;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.emails-attach-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.emails-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.emails-attach-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.emails-attach-btn:hover {
  background: #dbeafe;
}
.emails-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.emails-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}
.emails-attach-chip button {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.emails-compose-richtext {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.emails-compose-richtext .prop-richtext-toolbar,
.prop-richtext-toolbar--compact {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
}
.emails-compose-richtext .prop-richtext-toolbar {
  position: static;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: none;
}
.emails-compose-richtext .prop-richtext-btn,
.prop-richtext-toolbar--compact .prop-richtext-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  flex: 0 0 auto;
  justify-content: center;
  font-size: 13px;
}
.emails-compose-richtext .prop-richtext-btn svg,
.prop-richtext-toolbar--compact .prop-richtext-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}
.emails-compose-richtext .prop-richtext-sep,
.prop-richtext-toolbar--compact .prop-richtext-sep {
  flex: 0 0 auto;
  margin: 0 1px;
}
.emails-compose-richtext .prop-richtext-size,
.prop-richtext-toolbar--compact .prop-richtext-size,
.emails-compose-richtext .prop-richtext-spacing,
.prop-richtext-toolbar--compact .prop-richtext-spacing,
.emails-compose-richtext .prop-richtext-color,
.prop-richtext-toolbar--compact .prop-richtext-color {
  flex: 0 0 auto;
}
.emails-compose-editor.prop-richtext-editor {
  min-height: 180px;
  max-height: min(48vh, 420px);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
.emails-message-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 14px;
  margin: 0;
}
.emails-message-divider {
  height: 1px;
}
/* Connect section */
.emails-connect-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}
.emails-connect-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 400px;
  padding: 48px 40px;
  border: 1px solid #e8edf5;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 30px -16px rgba(15, 23, 42, 0.18);
  text-align: center;
}
.emails-connect-card svg {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: #2563eb;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.emails-connect-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}
.emails-connect-card p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}
.emails-page-loader {
  margin: 40px auto;
}
.emails-thread-loader {
  position: relative;
  inset: auto;
  min-height: 280px;
  margin: 24px auto;
  background: transparent;
  backdrop-filter: none;
}
.emails-thread-loader .page-orbit-loader-inner p {
  color: #64748b;
}
@media (max-width: 860px) {
  .emails-page {
    height: auto;
    overflow: visible;
  }
  .emails-hero {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .emails-hero-side {
    width: 100%;
  }
  .emails-account-card {
    flex-direction: column;
    align-items: stretch;
  }
  .emails-hero-actions {
    width: 100%;
  }
  .emails-sync-btn,
  .emails-compose-btn {
    flex: 1;
    justify-content: center;
  }
  .emails-shell {
    min-height: 70vh;
  }
  .emails-folders {
    width: 100%;
  }
  .emails-folder {
    flex: 1;
    justify-content: center;
  }
  .emails-search {
    width: 100%;
  }
  .emails-layout {
    min-height: 520px;
  }
  .emails-list {
    width: 100%;
  }
  .emails-list-column {
    width: 100%;
    min-width: 0;
    border-right: none;
  }
  .emails-layout:has(.emails-thread-content:not(.hidden)) .emails-list-column {
    display: none;
  }
  .emails-layout:has(.emails-thread-content:not(.hidden)) .emails-list {
    display: none;
  }
  .emails-thread-back {
    display: inline-flex;
  }
}
.emails-env-hint {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #334155;
  text-align: left;
  white-space: pre;
  width: 100%;
}

/* Technician site update — drawer summary + modal form */
.wo-tech-site-update-card.is-empty .wo-tech-site-update-head {
  margin-bottom: 0;
}
.wo-tech-site-empty-actions {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}
.wo-tech-site-fill-btn {
  min-width: 220px;
}
.wo-tech-site-has-data {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wo-tech-site-has-data-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.wo-tech-site-delete-btn {
  color: #b91c1c;
  border-color: #fecaca;
}
.wo-tech-site-delete-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.wo-tech-site-compact {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.wo-tech-site-compact-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.wo-tech-site-compact-date {
  font-size: 13px;
  color: #64748b;
}
.wo-tech-site-compact-parts {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}
.wo-tech-site-view-panel {
  max-height: min(72vh, 760px);
  overflow-y: auto;
}
.wo-tech-site-update-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.wo-tech-site-open-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.wo-tech-site-update-summary {
  margin-top: 4px;
}
.wo-tech-update-summary-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wo-tech-update-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.wo-tech-update-item {
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.wo-tech-update-item span {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}
.wo-tech-update-item strong {
  font-size: 14px;
  color: #0f172a;
}
.wo-tech-outcome-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.wo-tech-outcome-badge.outcome-job_completed { background: #dcfce7; color: #166534; }
.wo-tech-outcome-badge.outcome-return_trip_needed { background: #ffedd5; color: #9a3412; }
.wo-tech-outcome-badge.outcome-parts_needed { background: #ede9fe; color: #5b21b6; }
.wo-tech-outcome-badge.outcome-proposal_needed { background: #dbeafe; color: #1d4ed8; }
.wo-tech-outcome-badge.outcome-none { background: #f1f5f9; color: #64748b; }
.wo-tech-update-block {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.wo-tech-update-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}
.wo-tech-update-block p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
  white-space: pre-wrap;
}
.wo-tech-media-card .wo-view-images-grid {
  margin-top: 4px;
}

.wo-tech-site-modal .modal-header {
  align-items: flex-start;
}
.wo-tech-site-modal-copy {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}
.wo-tech-site-form-body {
  max-height: min(72vh, 760px);
  overflow-y: auto;
}
.wo-tech-site-section + .wo-tech-site-section {
  margin-top: 18px;
}
.wo-tech-image-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}
.wo-tech-image-group:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}
.wo-tech-image-group .field-label {
  display: block;
  margin-bottom: 8px;
}
.wo-tech-site-form .wo-image-dropzone {
  margin-top: 0;
}
.wo-tech-site-form .part-images-grid {
  margin-top: 12px;
}
.wo-tech-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.wo-tech-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 8px;
  font-size: 11px;
  text-align: center;
  color: #64748b;
}
.wo-tech-site-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.wo-tech-site-modal-note {
  flex: 1 1 220px;
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}
.wo-tech-site-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.wo-tech-site-progress-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.wo-tech-site-progress-step:not(:disabled):hover {
  border-color: #93c5fd;
  background: #f8fbff;
}
.wo-tech-site-progress-step.is-done {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}
.wo-tech-site-progress-step.is-busy {
  opacity: 0.72;
  cursor: wait;
}
.wo-tech-site-progress-step:disabled {
  cursor: default;
}
.wo-tech-site-progress-dot {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: #e2e8f0;
  color: #64748b;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.wo-tech-site-progress-step.is-done .wo-tech-site-progress-dot {
  background: #34d399;
  color: #fff;
  box-shadow: 0 0 0 1px #34d399;
}
.wo-tech-site-progress-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wo-tech-site-progress-copy strong {
  font-size: 14px;
  color: #0f172a;
}
.wo-tech-site-progress-copy span {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}
.field-req {
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
}

/* Audit Log */
.audit-log-table { min-width: 980px; }
.audit-log-timestamp,
.audit-log-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.audit-log-clock,
.audit-log-user-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #94a3b8;
}
.audit-log-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #f1f5f9;
  color: #64748b;
  flex: 0 0 auto;
}
.audit-log-user span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.audit-log-user strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.audit-log-user small {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}
.audit-log-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-log-pill-action {
  background: #f1f5f9;
  color: #334155;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}
.audit-log-pill-resource {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: #f3e8ff;
  color: #6b21a8;
  white-space: normal;
  max-width: min(360px, 42vw);
  line-height: 1.35;
  padding: 6px 10px;
}
.audit-log-module {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7c3aed;
  opacity: 0.85;
}
.audit-log-title {
  font-size: 12px;
  font-weight: 700;
  color: #5b21b6;
  word-break: break-word;
}
.audit-log-details {
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  max-width: min(420px, 46vw);
  white-space: normal;
  word-break: break-word;
}
.audit-log-details-empty {
  color: #94a3b8;
}
.audit-log-ip {
  font-variant-numeric: tabular-nums;
  color: #334155;
  white-space: nowrap;
}

/* Preventive PO Budget view card */
.data-table tbody tr.po-budget-row.is-clickable {
  cursor: pointer;
}
.data-table tbody tr.po-budget-row.is-clickable:hover {
  background: #eff6ff;
}
.po-budget-view-modal .po-budget-view-header {
  align-items: flex-start;
  gap: 12px;
}
.po-budget-view-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.po-budget-view-modal #preventivePoBudgetViewTitle {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.po-budget-view-body {
  padding: 8px 22px 18px;
  display: grid;
  gap: 18px;
}
.po-budget-view-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(145deg, #f8fbff 0%, #eef4ff 55%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
}
.po-budget-view-hero-wide {
  grid-column: 1 / -1;
}
.po-budget-view-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.po-budget-view-value {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}
.po-budget-view-notes {
  font-weight: 600;
  color: #334155;
}
.po-budget-view-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.po-budget-stat {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}
.po-budget-stat-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.po-budget-stat-value {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.po-budget-stat.is-used {
  background: #fff7ed;
  border-color: #fed7aa;
}
.po-budget-stat.is-used .po-budget-stat-value {
  color: #c2410c;
}
.po-budget-stat.is-remaining {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.po-budget-stat.is-remaining .po-budget-stat-value {
  color: #047857;
}
.po-budget-stat.is-low {
  background: #fef2f2;
  border-color: #fecaca;
}
.po-budget-stat.is-low .po-budget-stat-value {
  color: #b91c1c;
}
.po-budget-progress {
  display: grid;
  gap: 8px;
}
.po-budget-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}
.po-budget-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.po-budget-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}
.po-budget-progress-fill.is-low {
  background: linear-gradient(90deg, #f97316, #dc2626);
}
.po-budget-usage-section {
  display: grid;
  gap: 12px;
}
.po-budget-usage-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.po-budget-usage-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}
.po-budget-usage-grid {
  display: grid;
  gap: 10px;
}
.po-budget-usage-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}
.po-budget-usage-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.po-budget-usage-card-top h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.po-budget-usage-qty {
  flex: 0 0 auto;
  min-width: 42px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}
.po-budget-usage-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: #64748b;
}
.po-budget-usage-card-meta strong {
  color: #0f172a;
  font-weight: 800;
}
.po-budget-usage-empty {
  padding: 18px 16px;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
@media (max-width: 720px) {
  .po-budget-view-stats,
  .po-budget-view-hero {
    grid-template-columns: 1fr;
  }
}

/* ── Monthly Top-5 wishes celebration ─────────────────────────────────────── */
.mwish-host {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.mwish-host.show {
  opacity: 1;
  pointer-events: auto;
}
.mwish-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
}
.mwish-dialog {
  position: relative;
  width: min(1280px, calc(100vw - 24px));
  max-height: min(94vh, 980px);
  overflow: auto;
  border-radius: 28px;
  padding: 26px 26px 24px;
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.28), transparent 36%),
    radial-gradient(circle at 88% 8%, rgba(220, 38, 38, 0.18), transparent 34%),
    linear-gradient(165deg, #070b16 0%, #0f172a 46%, #1e293b 100%);
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 34px 90px rgba(2, 6, 23, 0.62);
  color: #e2e8f0;
}
.mwish-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.1);
  color: #f8fafc;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}
.mwish-close:hover {
  background: rgba(248, 250, 252, 0.2);
}
.mwish-dialog-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2px 48px 20px 2px;
}
.mwish-brand-logo {
  width: auto;
  height: 48px;
  max-width: min(220px, 42vw);
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent;
  filter: drop-shadow(0 4px 12px rgba(2, 6, 23, 0.45));
}
.mwish-dialog-brand strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.01em;
}
.mwish-dialog-brand span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: #93c5fd;
  font-weight: 650;
}
.mwish-board-kicker {
  margin: 0 0 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #93c5fd;
}
.mwish-board-stage {
  position: relative;
  isolation: isolate;
}
.mwish-board-logo-bg {
  position: absolute;
  inset: 8% 6% 4%;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
}
.mwish-board-logo-bg img {
  width: min(720px, 92%);
  max-height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(2, 6, 23, 0.35));
}
.mwish-board-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.mwish-single {
  display: grid;
  justify-items: center;
}
.mwish-single .mwish-card {
  width: min(420px, 100%);
}
.mwish-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 24px 16px 20px;
  min-height: 360px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(8, 15, 30, 0.72), rgba(15, 23, 42, 0.82)),
    linear-gradient(145deg, rgba(37, 99, 235, 0.32), rgba(220, 38, 38, 0.16));
  border: 1px solid rgba(96, 165, 250, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 16px 34px rgba(2, 6, 23, 0.4);
}
.mwish-card.is-self {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.28), 0 18px 40px rgba(2, 6, 23, 0.45);
}
.mwish-card-logo-bg {
  position: absolute;
  inset: 12% 8% 8%;
  display: grid;
  place-items: center;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.mwish-card-logo-bg img {
  width: min(280px, 92%);
  max-height: 70%;
  object-fit: contain;
}
.mwish-card-glow {
  position: absolute;
  inset: -36% -18% auto;
  height: 68%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.38), transparent 70%);
  pointer-events: none;
}
.mwish-crest {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.mwish-avatar-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1d4ed8, #0f172a 55%, #b91c1c);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.58), 0 12px 28px rgba(2, 6, 23, 0.5);
  overflow: hidden;
}
.mwish-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mwish-neutral-icon {
  width: 68px;
  height: 68px;
}
.mwish-crown {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  color: #fbbf24;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.mwish-laurel {
  width: 20px;
  height: 62px;
  border-radius: 40px 8px 40px 8px;
  background: linear-gradient(180deg, #fde68a, #b45309);
  opacity: 0.9;
  transform: rotate(-18deg);
}
.mwish-laurel-right {
  transform: rotate(18deg) scaleX(-1);
}
.mwish-name-ribbon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78%;
  margin: 0 auto 10px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f172a, #1e3a8a, #0f172a);
  border: 1px solid rgba(251, 191, 36, 0.58);
  color: #fde68a;
  font-size: 15px;
  font-weight: 800;
}
.mwish-rank {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #93c5fd;
}
.mwish-headline {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: 1.08;
  color: #fde68a;
  text-shadow: 0 2px 14px rgba(251, 191, 36, 0.38);
}
.mwish-sub {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  font-size: 14px;
  font-style: italic;
  color: #e2e8f0;
}
.mwish-meta {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  font-size: 13px;
  color: #94a3b8;
}
.mwish-meta strong {
  color: #f8fafc;
}
.mwish-footer-ribbon {
  position: relative;
  z-index: 1;
  margin: 14px auto 0;
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}
.mwish-brand {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  font-size: 12px;
  color: #64748b;
}
.mwish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.mwish-btn-soft,
.mwish-btn-stop {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 750;
}
.mwish-btn-soft {
  background: rgba(248, 250, 252, 0.08) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  color: #e2e8f0 !important;
}
.mwish-preview-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #fbbf24;
}
.mwish-confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 13050;
}
.mwish-cannon {
  position: fixed;
  width: 16px;
  height: 40px;
  border-radius: 10px 10px 5px 5px;
  background: linear-gradient(180deg, #fde68a, #b45309);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  z-index: 13051;
  pointer-events: none;
  animation: mwish-cannon-kick 0.32s ease-out infinite alternate;
}
.mwish-cannon-left {
  transform: rotate(-30deg);
}
.mwish-cannon-right {
  transform: rotate(30deg);
}
@keyframes mwish-cannon-kick {
  from { translate: 0 0; }
  to { translate: 0 -4px; }
}
@media (max-width: 1100px) {
  .mwish-board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .mwish-board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mwish-dialog {
    padding: 20px 16px 18px;
  }
}
@media (max-width: 560px) {
  .mwish-board-grid {
    grid-template-columns: 1fr;
  }
  .mwish-headline {
    font-size: 26px;
  }
  .mwish-card {
    min-height: 0;
  }
}

/* Profile mascot (ported from profile-mascot-v5/v7) */
@property --bs-mascot-a {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.topnav.bs-mascot-topnav {
  height: var(--topnav-h);
  min-height: var(--topnav-h);
  max-height: var(--topnav-h);
  overflow: visible !important;
}
.bs-mascot-topnav-right,
.bs-mascot-topnav .topnav-inner {
  height: var(--topnav-h);
  overflow: visible !important;
}
.bs-mascot-stage {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  overflow: visible;
  width: 132px;
  height: 64px;
}
.bs-mascot-stage-inner {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 250px;
  height: 120px;
  transform: scale(0.52);
  transform-origin: right bottom;
  overflow: visible;
}
.bs-mascot-str {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 2;
}
#bsMascotKnob {
  transition: opacity 0.3s ease;
}
.bs-mascot-hero {
  position: absolute;
  left: 0;
  top: 0;
  width: 70px;
  height: 120px;
  transform-origin: 35px 118px;
  z-index: 3;
  pointer-events: none;
}
#bsMascotFig {
  overflow: visible;
  display: block;
  transform-origin: 35px 0;
  filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.18));
}
.bs-mascot-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: bs-mascot-blink 4s infinite;
}
@keyframes bs-mascot-blink {
  0%,
  94%,
  100% { transform: scaleY(1); }
  97% { transform: scaleY(0.1); }
}
.bs-mascot-bubble {
  position: absolute;
  /* Pre-scale canvas coords; ~0.52 scale → readable next to the lean pose. */
  left: 48px;
  top: -8px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  padding: 10px 18px;
  border-radius: 18px;
  opacity: 0;
  transform: scale(0.55) translateY(6px);
  transform-origin: 20% 100%;
  white-space: nowrap;
  transition: transform 0.32s cubic-bezier(0.3, 1.7, 0.5, 1), opacity 0.22s ease;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.4);
  z-index: 8;
  pointer-events: none;
}
.bs-mascot-bubble::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: -7px;
  border: 7px solid transparent;
  border-top-color: #2563eb;
  border-bottom: 0;
}
.bs-mascot-bubble.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.topnav-profile.bs-mascot-pill {
  position: relative;
  overflow: visible;
  border-color: #dbeafe;
  box-shadow: 0 0 0 2px #dbeafe;
  z-index: 1;
}
.topnav-profile.bs-mascot-pill::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 2.5px;
  pointer-events: none;
  z-index: 0;
  /* Soft blue band only — no harsh white spike */
  background: conic-gradient(
    from var(--bs-mascot-a, 0deg),
    transparent 0%,
    transparent 58%,
    rgba(147, 197, 253, 0.05) 68%,
    rgba(147, 197, 253, 0.45) 78%,
    #93c5fd 86%,
    #60a5fa 92%,
    rgba(147, 197, 253, 0.35) 96%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: bs-mascot-spin 7.2s linear infinite;
}
.topnav-profile.bs-mascot-pill > * {
  position: relative;
  z-index: 1;
}
@keyframes bs-mascot-spin {
  to { --bs-mascot-a: 360deg; }
}
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .topnav-profile.bs-mascot-pill::before {
    display: none;
  }
  .topnav-profile.bs-mascot-pill {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 0 16px rgba(37, 99, 235, 0.2);
  }
}
#profileName.bs-mascot-name {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.bs-mascot-letter {
  display: inline-block;
  white-space: pre;
  transition: color 0.35s ease, text-shadow 0.35s ease;
}
.bs-mascot-letter.lit {
  color: #3b82f6;
  text-shadow: 0 0 8px rgba(147, 197, 253, 0.75);
}
#profileName.bs-mascot-name-glow .bs-mascot-letter.lit {
  animation: bs-mascot-name-run 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 90ms);
}
@keyframes bs-mascot-name-run {
  0%,
  100% {
    color: #2563eb;
    text-shadow: 0 0 6px rgba(147, 197, 253, 0.55);
  }
  50% {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(147, 197, 253, 0.9), 0 0 18px rgba(96, 165, 250, 0.45);
  }
}
@media (max-width: 899px), (prefers-reduced-motion: reduce) {
  .bs-mascot-stage {
    opacity: 0.92;
  }
  .topnav-profile.bs-mascot-pill::before {
    animation: none;
    background: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
  }
}
