/* STARS RCM PRO v4.5.2-uat1 — Planning Experience visual layer */
.pw-workspace {
  --pwx-bg: #080d15;
  --pwx-bg-soft: #0d1420;
  --pwx-surface: #111a28;
  --pwx-surface-2: #162234;
  --pwx-surface-3: #1c2a3f;
  --pwx-border: #263751;
  --pwx-border-strong: #385071;
  --pwx-text: #f5f8fc;
  --pwx-muted: #91a3ba;
  --pwx-subtle: #60748f;
  --pwx-accent: #f5b700;
  --pwx-accent-2: #ffcc32;
  --pwx-shadow: 0 18px 55px rgba(0, 0, 0, .28);
  --pw-bg: var(--pwx-bg);
  --pw-panel: var(--pwx-surface);
  --pw-panel2: var(--pwx-surface-2);
  --pw-border: var(--pwx-border);
  --pw-text: var(--pwx-text);
  --pw-muted: var(--pwx-muted);
  color: var(--pwx-text);
  background:
    radial-gradient(circle at 77% -18%, rgba(245, 183, 0, .08), transparent 32%),
    radial-gradient(circle at 12% 100%, rgba(75, 163, 255, .08), transparent 34%),
    var(--pwx-bg);
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1, "cv04" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-theme="light"] .pw-workspace {
  --pwx-bg: #eef3f8;
  --pwx-bg-soft: #f7f9fc;
  --pwx-surface: #ffffff;
  --pwx-surface-2: #f4f7fb;
  --pwx-surface-3: #e9eff6;
  --pwx-border: #d6e0eb;
  --pwx-border-strong: #b9c8d8;
  --pwx-text: #152033;
  --pwx-muted: #56677b;
  --pwx-subtle: #7b8ba0;
  --pwx-shadow: 0 18px 48px rgba(37, 55, 78, .12);
  background:
    radial-gradient(circle at 77% -18%, rgba(245, 183, 0, .13), transparent 34%),
    radial-gradient(circle at 12% 100%, rgba(75, 163, 255, .10), transparent 34%),
    var(--pwx-bg);
}

.pw-workspace :is(button, input, select, textarea) {
  font: inherit;
}

.pw-workspace :is(h1, h2, h3, b, strong, th, button) {
  font-family: "Segoe UI Variable Display", "Aptos Display", "Segoe UI", system-ui, sans-serif;
}

.pw-titlebar {
  position: relative;
  height: 76px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--pwx-bg-soft) 94%, transparent);
  border-bottom: 1px solid var(--pwx-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
  backdrop-filter: blur(18px) saturate(145%);
}

.pw-titlebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--pwx-accent), rgba(245, 183, 0, .06) 38%, rgba(75, 163, 255, .18));
  pointer-events: none;
}

.pw-brand {
  min-width: 0;
  gap: 13px;
}

.pwx-enhanced .pw-brand > .pw-app-icon {
  display: none;
}

.pw-company-logo-wrap {
  flex: 0 0 auto;
  width: 58px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid rgba(245, 183, 0, .38);
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 9px 24px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 255, 255, .65);
}

.pw-company-logo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pw-company-logo-fallback {
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.4px;
  color: #7b1f26;
}

.pw-brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pw-brand-copy .pw-company-name {
  color: var(--pwx-accent-2);
  font-size: 9px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: 1.35px;
  text-transform: uppercase;
}

html[data-theme="light"] .pw-brand-copy .pw-company-name {
  color: #8b6300;
}

.pw-brand-copy > b {
  overflow: hidden;
  color: var(--pwx-text);
  font-size: 16px;
  line-height: 1.18;
  font-weight: 780;
  letter-spacing: -.25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pw-brand-copy > small {
  margin: 0;
  color: var(--pwx-muted);
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: .25px;
}

.pw-title-actions {
  gap: 8px;
}

.pw-title-actions button,
.pw-head-actions button,
.pw-table-wrap button,
.pw-modal-actions button,
.pw-filterbar button {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid var(--pwx-border);
  border-radius: 10px;
  background: var(--pwx-surface-2);
  color: var(--pwx-text);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .15px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .08);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.pw-title-actions button:hover,
.pw-head-actions button:hover,
.pw-table-wrap button:hover,
.pw-modal-actions button:hover,
.pw-filterbar button:hover {
  border-color: var(--pwx-border-strong);
  background: var(--pwx-surface-3);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.pw-title-actions .pw-close {
  min-width: 42px;
  color: #ffb4bb;
  background: rgba(143, 36, 49, .30);
  border-color: rgba(255, 93, 108, .38);
}

html[data-theme="light"] .pw-title-actions .pw-close {
  color: #a12434;
  background: #fff0f2;
}

.pw-theme-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.pw-theme-glyph {
  font-size: 15px;
  line-height: 1;
}

.pw-theme-label {
  font-size: 9px;
}

.pw-body {
  grid-template-columns: 248px minmax(0, 1fr);
  height: calc(100dvh - 76px);
}

.pw-sidebar {
  padding: 16px 12px;
  background: color-mix(in srgb, var(--pwx-bg-soft) 97%, transparent);
  border-right: 1px solid var(--pwx-border);
  scrollbar-width: thin;
  scrollbar-color: var(--pwx-border-strong) transparent;
}

.pw-private-badge {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 9px 11px;
  margin: 0 2px 12px;
  border: 1px solid rgba(255, 93, 108, .28);
  border-radius: 10px;
  color: #ffb3bb;
  background: linear-gradient(120deg, rgba(255, 93, 108, .12), rgba(255, 93, 108, .03));
  font-size: 8px;
  font-weight: 800;
}

html[data-theme="light"] .pw-private-badge {
  color: #a42333;
}

.pw-sidebar button {
  min-height: 43px;
  margin: 3px 0;
  padding: 10px 12px;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--pwx-muted);
  font-size: 11px;
  font-weight: 670;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.pw-sidebar button span {
  width: 22px;
  color: var(--pwx-subtle);
  font-size: 14px;
}

.pw-sidebar button:hover {
  color: var(--pwx-text);
  border-color: var(--pwx-border);
  background: var(--pwx-surface-2);
  transform: translateX(2px);
}

.pw-sidebar button.active {
  padding-left: 10px;
  color: #ffe27f;
  border: 1px solid rgba(245, 183, 0, .23);
  border-left: 3px solid var(--pwx-accent);
  background: linear-gradient(90deg, rgba(245, 183, 0, .18), rgba(245, 183, 0, .035));
  box-shadow: inset 0 1px rgba(255, 255, 255, .03);
}

html[data-theme="light"] .pw-sidebar button.active {
  color: #6d5000;
}

.pw-side-foot {
  color: var(--pwx-subtle);
  border-color: var(--pwx-border);
  font-size: 8px;
}

.pw-main {
  min-width: 0;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--pwx-border-strong) transparent;
}

#pwContent {
  width: 100%;
  max-width: 1880px;
  min-width: 0;
  margin: 0 auto;
  padding: 28px 28px 52px;
}

.pw-page-head {
  align-items: center;
  margin-bottom: 22px;
}

.pw-page-head small {
  color: var(--pwx-accent-2);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.8px;
}

html[data-theme="light"] .pw-page-head small {
  color: #8b6300;
}

.pw-page-head h1 {
  margin: 6px 0 7px;
  color: var(--pwx-text);
  font-size: clamp(25px, 2.3vw, 34px);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: -.9px;
}

.pw-page-head p {
  max-width: 820px;
  color: var(--pwx-muted);
  font-size: 11px;
  line-height: 1.55;
}

.pw-primary {
  color: #1a1408 !important;
  background: linear-gradient(135deg, #ffd33c, #eba900) !important;
  border-color: #e7a900 !important;
  box-shadow: 0 8px 22px rgba(245, 183, 0, .22) !important;
}

.pw-kpis {
  grid-template-columns: repeat(8, minmax(112px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.pw-kpis button {
  position: relative;
  min-height: 94px;
  padding: 16px 15px 14px;
  overflow: hidden;
  border: 1px solid var(--pwx-border);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--pwx-surface-2), var(--pwx-surface));
  color: var(--pwx-text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .10);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.pw-kpis button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--pwx-accent);
  opacity: .82;
}

.pw-kpis button:nth-child(3n + 2)::before { background: #4ba3ff; }
.pw-kpis button:nth-child(3n)::before { background: #34d399; }
.pw-kpis button:last-child::before { background: #ff5d6c; }

.pw-kpis button:hover {
  border-color: var(--pwx-border-strong);
  transform: translateY(-3px);
  box-shadow: var(--pwx-shadow);
}

.pw-kpis small {
  color: var(--pwx-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .5px;
}

.pw-kpis b {
  margin-top: 10px;
  font-size: 27px;
  font-weight: 760;
  letter-spacing: -.6px;
}

.pw-dashboard-grid {
  gap: 15px;
}

.pw-panel,
.pw-table-wrap,
.pw-detail-section,
.pw-budget-cards article {
  border: 1px solid var(--pwx-border);
  background: color-mix(in srgb, var(--pwx-surface) 96%, transparent);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .08);
}

.pw-panel {
  min-height: 190px;
  padding: 18px;
  border-radius: 15px;
}

.pw-panel h3 {
  margin-bottom: 15px;
  color: var(--pwx-text);
  font-size: 12px;
  font-weight: 740;
}

.pw-empty {
  min-height: 175px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  color: var(--pwx-muted);
}

.pw-empty::before {
  content: "⌁";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 6px;
  border: 1px solid var(--pwx-border);
  border-radius: 10px;
  color: var(--pwx-accent-2);
  background: var(--pwx-surface-2);
  font-size: 19px;
}

.pw-empty b {
  color: var(--pwx-text);
  font-size: 13px;
  font-weight: 720;
}

.pw-empty p {
  color: var(--pwx-muted);
  font-size: 9px;
}

.pw-table-wrap {
  border-radius: 13px;
  scrollbar-width: thin;
  scrollbar-color: var(--pwx-border-strong) transparent;
}

.pw-table-wrap thead,
.pw-panel thead,
.pw-detail-section thead {
  background: var(--pwx-surface-3);
}

.pw-table-wrap th,
.pw-panel th,
.pw-detail-section th {
  padding: 12px 10px;
  color: var(--pwx-muted);
  border-color: var(--pwx-border);
  font-size: 8px;
  font-weight: 780;
}

.pw-table-wrap td,
.pw-panel td,
.pw-detail-section td {
  padding: 11px 10px;
  border-color: var(--pwx-border);
  color: var(--pwx-text);
}

.pw-table-wrap tr:hover td {
  background: color-mix(in srgb, var(--pwx-surface-3) 72%, transparent);
}

.pw-filterbar input,
.pw-filterbar select,
.pw-filterbar label,
.pw-lock-card input,
.pw-form-grid input,
.pw-form-grid select,
.pw-form-grid textarea {
  min-height: 40px;
  border: 1px solid var(--pwx-border);
  border-radius: 10px;
  background: var(--pwx-surface);
  color: var(--pwx-text);
  font-size: 11px;
}

.pw-modal-backdrop {
  background: rgba(3, 7, 13, .68);
  backdrop-filter: blur(10px) saturate(120%);
}

.pw-modal {
  border: 1px solid var(--pwx-border-strong);
  border-radius: 18px;
  background: var(--pwx-surface);
  color: var(--pwx-text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .40);
}

.pw-detail-kpis div,
.pw-detail-grid div,
.pw-detail-section,
.pw-readiness,
.pw-role-box,
.pw-readiness label,
.pw-role-box label {
  border-color: var(--pwx-border);
  background: var(--pwx-surface-2);
  color: var(--pwx-text);
}

html[data-theme="light"] .pw-title-actions .pw-close,
html[data-theme="light"] .pw-panel,
html[data-theme="light"] .pw-table-wrap,
html[data-theme="light"] .pw-detail-section,
html[data-theme="light"] .pw-budget-cards article,
html[data-theme="light"] .pw-kpis button {
  box-shadow: 0 10px 28px rgba(42, 61, 84, .08);
}

@media (max-width: 1399px) {
  .pw-kpis {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }
}

@media (max-width: 980px) {
  .pw-titlebar {
    height: 70px;
    padding: 0 14px;
  }

  .pw-company-logo-wrap {
    width: 51px;
    height: 43px;
  }

  .pw-brand-copy > b {
    font-size: 14px;
  }

  .pw-body {
    grid-template-columns: 76px minmax(0, 1fr);
    height: calc(100dvh - 70px);
  }

  .pw-sidebar {
    padding: 10px 7px;
  }

  .pw-private-badge,
  .pw-side-foot {
    display: none;
  }

  .pw-sidebar button {
    justify-content: center;
    min-height: 46px;
    padding: 8px 4px;
    font-size: 0;
  }

  .pw-sidebar button span {
    width: auto;
    font-size: 16px;
  }

  .pw-sidebar button.active {
    padding-left: 1px;
  }

  #pwContent {
    min-width: 0;
    padding: 22px 18px 40px;
  }

  .pw-page-head {
    align-items: flex-start;
  }

  .pw-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pw-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .pw-span-2 {
    grid-column: auto;
  }

  .pw-budget-cards,
  .pw-form-grid.three {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .pw-titlebar {
    height: 68px;
    padding: 0 10px;
  }

  .pw-brand {
    gap: 8px;
  }

  .pw-company-logo-wrap {
    width: 46px;
    height: 40px;
    border-radius: 10px;
  }

  .pw-brand-copy .pw-company-name {
    max-width: 142px;
    overflow: hidden;
    font-size: 7px;
    letter-spacing: .8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pw-brand-copy > b {
    max-width: 150px;
    font-size: 12px;
  }

  .pw-brand-copy > small,
  .pw-theme-label {
    display: none;
  }

  .pw-title-actions {
    gap: 5px;
  }

  .pw-title-actions button:not(.pw-close) {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 0;
  }

  .pw-title-actions button:first-child::before { content: "⇩"; font-size: 16px; }
  .pw-title-actions button:nth-child(2)::before { content: "🔒"; font-size: 13px; }
  .pw-title-actions .pw-theme-switch::before { content: none; }
  .pw-theme-switch .pw-theme-glyph { font-size: 16px; }

  .pw-title-actions .pw-close {
    min-width: 38px;
    min-height: 38px;
    padding: 0 9px;
  }

  .pw-body {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 68px);
  }

  .pw-sidebar {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    gap: 5px;
    padding: 7px 9px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--pwx-border);
  }

  .pw-sidebar button {
    flex: 0 0 48px;
    width: 48px;
    min-height: 42px;
    margin: 0;
    border-radius: 9px;
  }

  .pw-main {
    flex: 1 1 auto;
  }

  #pwContent {
    padding: 18px 12px 32px;
  }

  .pw-page-head {
    flex-direction: column;
    gap: 13px;
    margin-bottom: 17px;
  }

  .pw-page-head h1 {
    font-size: 25px;
  }

  .pw-head-actions {
    width: 100%;
  }

  .pw-head-actions button {
    flex: 1;
  }

  .pw-kpis {
    gap: 8px;
  }

  .pw-kpis button {
    min-height: 84px;
    padding: 13px 12px;
  }

  .pw-kpis b {
    font-size: 23px;
  }

  .pw-panel {
    min-height: 170px;
    padding: 14px;
  }

  .pw-budget-cards,
  .pw-form-grid,
  .pw-form-grid.three,
  .pw-detail-kpis,
  .pw-detail-grid {
    grid-template-columns: 1fr;
  }

  .pw-filterbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pw-filterbar input,
  .pw-filterbar label,
  .pw-filterbar label input {
    width: 100%;
    min-width: 0;
  }

  .pw-modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .pw-modal,
  .pw-modal.wide {
    width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    padding: 18px 15px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pw-workspace *,
  .pw-workspace *::before,
  .pw-workspace *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
