/* Allied Professional theme variables */
:root,
[data-theme="dark"] {
  --bg: #0b1726;
  --sidebar: #081321;
  --panel: #102437;
  --panel-elevated: #0e2032;
  --panel-soft: #142b40;
  --panel-line: #24425c;
  --panel-line-soft: rgba(36, 66, 92, 0.72);
  --text: #eaf2ff;
  --text-secondary: #c7d6ea;
  --muted: #9fb0c8;
  --input-bg: #0b1b2b;
  --hover-bg: rgba(31, 160, 151, 0.14);
  --green: #19c37d;
  --green-dark: #0f9d6c;
  --blue: #294e98;
  --orange: #f4b63b;
  --yellow: #f4b63b;
  --red: #d42027;
  --purple: #7761d8;
  --cyan: #1fa097;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  --sidebar-width: 248px;
  --sidebar-rail-width: 76px;
  --sidebar-expanded-width: 248px;
  --detail-width: 360px;
  --detail-drawer-width: min(74vw, 1120px);
}

/* Phase 33: cyber public landing page */
.public-landing {
  overflow-x: hidden;
  background:
    linear-gradient(rgba(23, 238, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 238, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 28%, rgba(11, 211, 255, 0.22), transparent 28%),
    radial-gradient(circle at 14% 72%, rgba(244, 182, 59, 0.11), transparent 24%),
    linear-gradient(145deg, #020712 0%, #061122 42%, #02040a 100%);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

.public-landing::before,
.public-landing::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.public-landing::before {
  inset: 84px 32px 32px;
  border: 1px solid rgba(23, 238, 255, 0.12);
  box-shadow: inset 0 0 42px rgba(23, 238, 255, 0.08);
}

.public-landing::after {
  width: 420px;
  height: 420px;
  right: -150px;
  top: 18%;
  background: radial-gradient(circle, rgba(23, 238, 255, 0.14), transparent 68%);
}

.public-nav,
.cyber-public-main,
.public-footer {
  position: relative;
  z-index: 1;
}

.legacy-public-hero,
.legacy-public-actions,
.legacy-public-help {
  display: none !important;
}

.cyber-public-main {
  padding-top: 24px;
}

.cyber-hero-shell {
  grid-template-columns: minmax(220px, 0.82fr) minmax(420px, 1.18fr) minmax(220px, 0.82fr);
  align-items: center;
  gap: 18px;
}

.cyber-action-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.cyber-action-card {
  min-height: 142px;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(23, 238, 255, 0.34);
  border-radius: 8px;
  padding: 18px;
  color: #edfaff;
  background:
    linear-gradient(135deg, rgba(5, 17, 31, 0.94), rgba(6, 30, 45, 0.86)),
    radial-gradient(circle at 100% 0%, rgba(23, 238, 255, 0.16), transparent 36%);
  box-shadow: 0 0 0 1px rgba(23, 238, 255, 0.07), 0 18px 48px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.cyber-action-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #17eeff, transparent);
  opacity: 0.82;
}

.cyber-action-card::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 74px;
  right: -28px;
  bottom: -28px;
  border: 1px solid rgba(23, 238, 255, 0.2);
  transform: rotate(45deg);
}

.cyber-action-card:hover,
.cyber-action-card:focus-visible {
  border-color: rgba(23, 238, 255, 0.74);
  box-shadow: 0 0 22px rgba(23, 238, 255, 0.2), 0 20px 54px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.cyber-action-card strong {
  color: #f8fdff;
  font-size: 17px;
  line-height: 1.2;
}

.cyber-action-card small {
  max-width: 28ch;
  color: #a9c0d0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cyber-action-card em {
  color: #17eeff;
  font-style: normal;
  font-weight: 900;
}

.cyber-action-alert {
  border-color: rgba(255, 93, 93, 0.38);
}

.cyber-action-alert::before {
  background: linear-gradient(90deg, transparent, #ff7a7a, transparent);
}

.cyber-card-kicker {
  color: #75f4ff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.cyber-orb-zone {
  min-height: 640px;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  border: 1px solid rgba(23, 238, 255, 0.3);
  border-radius: 8px;
  padding: 32px;
  background:
    radial-gradient(circle at 50% 48%, rgba(23, 238, 255, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(7, 22, 38, 0.82), rgba(2, 8, 18, 0.92));
  box-shadow: inset 0 0 58px rgba(23, 238, 255, 0.08), 0 28px 70px rgba(0, 0, 0, 0.42);
}

.cyber-badge {
  border: 1px solid rgba(23, 238, 255, 0.35);
  border-radius: 999px;
  background: rgba(23, 238, 255, 0.08);
  color: #87f7ff;
}

.cyber-orb-zone h1 {
  max-width: 780px;
  margin: 16px auto 14px;
  color: #fbfeff;
  font-size: 42px;
  line-height: 1.08;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(23, 238, 255, 0.18);
}

.cyber-orb-zone .public-hero-text {
  max-width: 760px;
  color: #c5d7e4;
  font-size: 16px;
  line-height: 1.7;
}

.cyber-orb {
  position: relative;
  width: min(360px, 72vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 26px auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(247, 255, 255, 0.92) 0 10%, rgba(23, 238, 255, 0.3) 11% 22%, transparent 23%),
    radial-gradient(circle, rgba(23, 238, 255, 0.18), transparent 62%);
  box-shadow: 0 0 32px rgba(23, 238, 255, 0.4), inset 0 0 46px rgba(23, 238, 255, 0.18);
}

.cyber-orb-ring,
.cyber-orb-axis {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.cyber-orb-ring-one {
  border: 1px solid rgba(23, 238, 255, 0.72);
  box-shadow: 0 0 22px rgba(23, 238, 255, 0.32);
}

.cyber-orb-ring-two {
  inset: 34px;
  border: 1px dashed rgba(244, 182, 59, 0.68);
}

.cyber-orb-axis {
  inset: 18px;
  border-top: 1px solid rgba(23, 238, 255, 0.42);
  border-bottom: 1px solid rgba(23, 238, 255, 0.18);
}

.cyber-orb-axis-b {
  transform: rotate(90deg);
}

.cyber-orb-core {
  position: relative;
  z-index: 1;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  border: 1px solid rgba(23, 238, 255, 0.55);
  background: linear-gradient(180deg, rgba(5, 16, 28, 0.98), rgba(3, 8, 17, 0.98));
}

.cyber-orb-core strong,
.cyber-orb-core span {
  color: #faffff;
  font-weight: 950;
}

.cyber-orb-core strong {
  font-size: 26px;
}

.cyber-orb-core span {
  font-size: 50px;
  line-height: 0.95;
}

.cyber-orb-core small {
  color: #7ff5ff;
  font-weight: 800;
  text-transform: uppercase;
}

.cyber-hud-row,
.cyber-bottom-hud {
  display: grid;
  gap: 12px;
}

.cyber-hud-row {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cyber-hud-row span,
.cyber-bottom-hud article {
  min-width: 0;
  border: 1px solid rgba(23, 238, 255, 0.2);
  border-radius: 8px;
  background: rgba(6, 22, 36, 0.74);
  box-shadow: inset 0 0 24px rgba(23, 238, 255, 0.04);
}

.cyber-hud-row span {
  padding: 12px;
}

.cyber-hud-row strong,
.cyber-bottom-hud strong {
  display: block;
  color: #f8fdff;
}

.cyber-hud-row small,
.cyber-bottom-hud small {
  display: block;
  color: #9fb7c7;
  overflow-wrap: anywhere;
}

.cyber-bottom-hud {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.cyber-bottom-hud article {
  padding: 16px;
}

.cyber-bottom-hud article > span {
  display: block;
  margin-bottom: 8px;
  color: #75f4ff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .cyber-hero-shell {
    grid-template-columns: 1fr;
  }

  .cyber-orb-zone {
    order: -1;
    min-height: 0;
  }

  .cyber-action-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cyber-action-card {
    min-height: 150px;
  }
}

@media (max-width: 760px) {
  .public-landing::before {
    inset: 76px 12px 18px;
  }

  .cyber-public-main {
    padding-top: 12px;
  }

  .cyber-orb-zone {
    padding: 22px 16px;
  }

  .cyber-orb-zone h1 {
    font-size: 29px;
  }

  .cyber-orb-zone .public-hero-text {
    font-size: 14px;
  }

  .cyber-action-column,
  .cyber-hud-row,
  .cyber-bottom-hud {
    grid-template-columns: 1fr;
  }

  .cyber-action-card {
    min-height: 0;
  }

  .cyber-orb {
    width: min(292px, 78vw);
  }

  .cyber-orb-core {
    width: 136px;
    height: 136px;
  }

  .cyber-orb-core strong {
    font-size: 21px;
  }

  .cyber-orb-core span {
    font-size: 42px;
  }
}

/* Light review theme variables */
[data-theme="light"] {
  --bg: #eef3f8;
  --sidebar: #f8fafc;
  --panel: #ffffff;
  --panel-elevated: #f5f8fb;
  --panel-soft: #edf4f8;
  --panel-line: #cddbea;
  --panel-line-soft: #e3ebf3;
  --text: #0b1726;
  --text-secondary: #334b63;
  --muted: #667c95;
  --input-bg: #f8fbfd;
  --hover-bg: #e8f5f4;
  --green: #10895d;
  --green-dark: #059669;
  --blue: #294e98;
  --orange: #c98200;
  --yellow: #b77906;
  --red: #c01820;
  --purple: #7c3aed;
  --cyan: #1f8f88;
  --shadow: 0 18px 36px rgba(16, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 4px 0 6px;
  font-size: 28px;
}

.auth-subtitle,
.auth-user,
.auth-error {
  margin: 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  min-height: 44px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #071420;
  color: var(--text);
  padding: 0 12px;
}

.auth-error {
  color: #fecaca;
  min-height: 20px;
}

.auth-role {
  margin: 0;
  width: fit-content;
  border: 1px solid rgba(14, 165, 233, 0.45);
  border-radius: 999px;
  padding: 6px 10px;
  color: #bfdbfe;
  background: rgba(14, 165, 233, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.auth-gate.auth-session-bar {
  min-height: auto;
  display: flex;
  justify-content: flex-end;
  padding: 10px 18px;
  border-bottom: 1px solid var(--panel-line);
  position: sticky;
  top: 0;
  z-index: 9;
}

.auth-gate.auth-session-bar .auth-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  box-shadow: none;
}

.auth-gate.auth-session-bar .auth-card > div {
  margin-right: auto;
}

.auth-gate.auth-session-bar .auth-card h1,
.auth-gate.auth-session-bar .auth-subtitle {
  display: none;
}

.auth-gate.auth-session-bar .auth-card .eyebrow,
.auth-gate.auth-session-bar .auth-user,
.auth-gate.auth-session-bar .auth-role,
.auth-gate.auth-session-bar .auth-error {
  margin: 0;
}

.auth-gate.auth-session-bar .auth-user {
  margin-right: auto;
}

.auth-gate.auth-session-bar .auth-error {
  min-height: 0;
}

.public-landing {
  min-height: 100vh;
  color: #eaf2ff;
  background:
    radial-gradient(circle at 18% 18%, rgba(31, 160, 151, 0.18), transparent 34%),
    radial-gradient(circle at 82% 8%, rgba(244, 182, 59, 0.16), transparent 28%),
    linear-gradient(135deg, #081321 0%, #0b1726 52%, #102437 100%);
}

.public-header,
.public-footer,
.public-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.public-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(234, 242, 255, 0.12);
}

.public-brand div,
.public-footer div {
  display: grid;
  gap: 3px;
}

.public-brand strong,
.public-footer strong {
  font-size: 18px;
  letter-spacing: 0;
}

.public-brand span,
.public-footer span {
  color: #9fb0c8;
  font-size: 13px;
}

.public-header-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.public-language {
  display: grid;
  gap: 6px;
  color: #9fb0c8;
  font-size: 12px;
  font-weight: 800;
}

.public-landing .public-language select,
.public-landing .public-form input,
.public-landing .public-form textarea {
  border: 1px solid rgba(159, 176, 200, 0.34);
  border-radius: 8px;
  background: rgba(8, 19, 33, 0.72);
  color: #eaf2ff;
  padding: 10px 12px;
}

.public-language select {
  min-height: 42px;
}

.public-login-button {
  min-height: 42px;
}

.public-landing .primary-button {
  background: #294e98;
  color: #ffffff;
  border-color: #294e98;
}

.public-landing .ghost-button {
  background: rgba(234, 242, 255, 0.06);
  color: #eaf2ff;
  border-color: rgba(159, 176, 200, 0.34);
}

.public-landing .ghost-button:hover {
  background: rgba(31, 160, 151, 0.14);
  border-color: rgba(31, 160, 151, 0.58);
}

.public-main {
  display: grid;
  gap: 24px;
  padding: 24px 0 34px;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 26px;
  align-items: stretch;
}

.public-hero-copy,
.public-hero-panel,
.public-panel {
  border: 1px solid rgba(159, 176, 200, 0.22);
  border-radius: 14px;
  background: rgba(16, 36, 55, 0.78);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}

.public-hero-copy {
  padding: clamp(28px, 5vw, 56px);
  display: grid;
  align-content: center;
  gap: 18px;
}

.public-hero-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.public-hero-text {
  max-width: 720px;
  margin: 0;
  color: #c7d6ea;
  font-size: 17px;
  line-height: 1.65;
}

.public-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.public-hero-panel {
  min-height: 360px;
  position: relative;
  overflow: hidden;
  padding: 28px;
  display: grid;
  align-content: end;
}

.solar-sun {
  position: absolute;
  top: 34px;
  right: 38px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: #f4b63b;
  box-shadow: 0 0 60px rgba(244, 182, 59, 0.42);
}

.solar-panel-grid {
  position: absolute;
  left: 34px;
  bottom: 100px;
  width: min(330px, calc(100% - 68px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  transform: perspective(500px) rotateX(16deg) rotateZ(-5deg);
}

.solar-panel-grid span {
  aspect-ratio: 1.5;
  border: 1px solid rgba(234, 242, 255, 0.22);
  border-radius: 6px;
  background: linear-gradient(145deg, #294e98, #102b5e);
}

.public-hero-note {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(8, 19, 33, 0.72);
  border: 1px solid rgba(234, 242, 255, 0.14);
}

.public-hero-note span {
  color: #c7d6ea;
}

.public-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.public-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 10px;
  text-align: left;
  border: 1px solid rgba(159, 176, 200, 0.22);
  border-radius: 12px;
  background: rgba(16, 36, 55, 0.84);
  color: #eaf2ff;
  padding: 18px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.public-card:hover {
  border-color: rgba(31, 160, 151, 0.68);
  background: rgba(20, 43, 64, 0.92);
}

.public-card strong {
  font-size: 18px;
}

.public-card small {
  color: #9fb0c8;
  line-height: 1.5;
}

.public-card-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
}

.public-card-icon.teal {
  background: #1fa097;
}

.public-card-icon.amber {
  background: #c98200;
}

.public-card-icon.blue {
  background: #294e98;
}

.public-card-icon.red {
  background: #d42027;
}

.public-card-planned {
  border-style: dashed;
}

.public-panel {
  min-height: 230px;
  padding: 22px;
}

.public-panel-empty,
.public-panel-card {
  display: grid;
  gap: 14px;
}

.public-panel h2,
.public-panel p {
  margin: 0;
}

.public-panel p {
  color: #c7d6ea;
  line-height: 1.65;
}

.public-info-grid,
.public-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.public-info-grid span,
.public-form-message,
.public-upload-placeholder {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(159, 176, 200, 0.22);
  border-radius: 10px;
  background: rgba(8, 19, 33, 0.48);
}

.public-info-grid small,
.public-placeholder {
  color: #9fb0c8;
}

.public-form label {
  display: grid;
  gap: 7px;
  color: #9fb0c8;
  font-size: 13px;
  font-weight: 800;
}

.public-form-wide {
  grid-column: 1 / -1;
}

.public-form-message {
  color: #c7d6ea;
}

.public-upload-placeholder {
  color: #9fb0c8;
}

.public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(159, 176, 200, 0.18);
}

.public-footer-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: #9fb0c8;
  font-size: 13px;
}

.public-landing {
  --public-glass: rgba(16, 36, 55, 0.78);
  --public-glass-strong: rgba(11, 23, 38, 0.88);
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 12;
  width: min(1220px, calc(100% - 32px));
  min-height: 78px;
  border-bottom: 1px solid rgba(159, 176, 200, 0.14);
  backdrop-filter: blur(18px);
}

.public-brand img {
  width: 66px;
  height: 66px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.92);
}

.public-brand strong {
  font-size: 22px;
  color: #ffffff;
}

.public-main {
  width: min(1220px, calc(100% - 32px));
}

.public-badge {
  width: fit-content;
  margin: 0;
  border: 1px solid rgba(31, 160, 151, 0.42);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(31, 160, 151, 0.12);
  color: #7ee7df;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-hero {
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
}

.public-hero-copy {
  gap: 20px;
  border-color: rgba(159, 176, 200, 0.18);
  background:
    linear-gradient(145deg, rgba(16, 36, 55, 0.94), rgba(8, 19, 33, 0.82)),
    radial-gradient(circle at 12% 20%, rgba(31, 160, 151, 0.16), transparent 36%);
}

.public-hero-copy h1 {
  max-width: 820px;
  font-size: clamp(32px, 4.7vw, 58px);
  line-height: 1.05;
}

.public-hero-actions,
.public-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.public-secondary-actions {
  margin-top: -4px;
}

.public-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.public-trust-grid article {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid rgba(159, 176, 200, 0.2);
  border-radius: 10px;
  background: rgba(8, 19, 33, 0.46);
}

.public-trust-grid strong {
  font-size: 13px;
  color: #eaf2ff;
}

.public-trust-grid span {
  color: #9fb0c8;
  font-size: 12px;
  line-height: 1.4;
}

.public-hero-panel {
  border-color: rgba(31, 160, 151, 0.25);
  background:
    linear-gradient(160deg, rgba(16, 36, 55, 0.9), rgba(8, 19, 33, 0.92)),
    radial-gradient(circle at 70% 18%, rgba(244, 182, 59, 0.22), transparent 34%);
}

.solar-orbit {
  position: absolute;
  top: 30px;
  right: 28px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(244, 182, 59, 0.24);
  border-radius: 50%;
}

.solar-panel-grid {
  bottom: 118px;
  transform: perspective(620px) rotateX(22deg) rotateZ(-7deg);
}

.solar-panel-grid span {
  border-color: rgba(234, 242, 255, 0.26);
  background: linear-gradient(145deg, #294e98 0%, #102b5e 52%, #081321 100%);
  box-shadow: inset 0 0 18px rgba(31, 160, 151, 0.18);
}

.public-hero-note {
  border-color: rgba(244, 182, 59, 0.28);
}

.public-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-card {
  min-height: 124px;
  grid-template-columns: 46px minmax(0, 1fr);
  align-content: stretch;
  align-items: start;
  border-color: rgba(159, 176, 200, 0.18);
}

.public-card-content {
  display: grid;
  gap: 7px;
}

.public-card-content em {
  width: fit-content;
  margin-top: 3px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(31, 160, 151, 0.13);
  color: #7ee7df;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.public-card:focus-visible,
.public-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.auth-card {
  width: min(460px, 100%);
  border-color: rgba(159, 176, 200, 0.24);
  background:
    linear-gradient(150deg, rgba(16, 36, 55, 0.98), rgba(8, 19, 33, 0.98)),
    radial-gradient(circle at 84% 12%, rgba(244, 182, 59, 0.15), transparent 30%);
}

.auth-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.auth-card-head img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 12px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.92);
}

.auth-title-block {
  display: grid;
  gap: 4px;
}

.auth-title-block h1 {
  margin: 0;
}

.auth-language-row {
  min-width: 148px;
}

.auth-gate.auth-session-bar .auth-card-head,
.auth-gate.auth-session-bar .auth-title-block,
.auth-gate.auth-session-bar #authBackPublic {
  display: none;
}

.app-language-control {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.app-language-control select {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
}

/* Phase 16Y Fix2: premium public website UI */
.public-modal-open {
  overflow: hidden;
}

.public-landing {
  background:
    radial-gradient(circle at 12% 12%, rgba(31, 160, 151, 0.16), transparent 28%),
    radial-gradient(circle at 82% 4%, rgba(244, 182, 59, 0.16), transparent 24%),
    linear-gradient(140deg, #081321 0%, #0b1726 48%, #102437 100%);
}

.public-nav {
  backdrop-filter: blur(22px);
  background: rgba(8, 19, 33, 0.56);
}

.public-hero {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: clamp(18px, 3vw, 34px);
}

.public-hero-copy,
.public-hero-panel {
  border: 0;
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.public-hero-copy {
  padding: clamp(30px, 5vw, 58px);
  background:
    linear-gradient(145deg, rgba(16, 36, 55, 0.82), rgba(8, 19, 33, 0.72)),
    radial-gradient(circle at 8% 12%, rgba(31, 160, 151, 0.18), transparent 34%);
}

.public-hero-copy h1 {
  max-width: 760px;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.08;
}

.public-hero-text {
  max-width: 680px;
  font-size: 16px;
}

.public-badge {
  border: 0;
  background: rgba(31, 160, 151, 0.15);
  color: #86eee7;
}

.public-trust-grid article {
  border: 0;
  background: rgba(234, 242, 255, 0.055);
}

.public-hero-panel {
  min-height: 430px;
  background:
    radial-gradient(circle at 72% 16%, rgba(244, 182, 59, 0.28), transparent 30%),
    linear-gradient(155deg, rgba(20, 43, 64, 0.86), rgba(8, 19, 33, 0.92));
}

.solar-panel-grid {
  bottom: 150px;
  left: 36px;
  width: min(310px, calc(100% - 72px));
}

.public-hero-note {
  width: min(100%, 390px);
  border: 0;
  background: rgba(8, 19, 33, 0.66);
}

.portal-preview-list {
  position: absolute;
  right: 28px;
  bottom: 116px;
  width: min(210px, calc(100% - 56px));
  display: grid;
  gap: 8px;
}

.portal-preview-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(234, 242, 255, 0.09);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.portal-preview-list strong {
  color: #eaf2ff;
  font-size: 13px;
}

.portal-preview-list small {
  color: #9fb0c8;
  font-size: 11px;
}

.public-card-grid {
  gap: 18px;
}

.public-action-card {
  min-height: 164px;
  grid-template-columns: 1fr;
  border: 0;
  border-radius: 22px;
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(20, 43, 64, 0.88), rgba(8, 19, 33, 0.78)),
    radial-gradient(circle at 86% 16%, rgba(31, 160, 151, 0.11), transparent 34%);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.2);
}

.public-action-card .public-card-icon {
  width: 46px;
  height: 46px;
  position: relative;
  border-radius: 16px;
  color: transparent;
  background: rgba(234, 242, 255, 0.09);
}

.public-action-card .public-card-icon::before,
.public-action-card .public-card-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.icon-experience::before {
  inset: 12px 9px 11px;
  border-radius: 3px;
  background: linear-gradient(135deg, #1fa097, #294e98);
  transform: skewX(-12deg);
}

.icon-experience::after {
  left: 10px;
  right: 10px;
  bottom: 9px;
  height: 2px;
  background: #f4b63b;
}

.icon-enquiry::before {
  inset: 11px;
  border: 2px solid #f4b63b;
  border-radius: 50%;
}

.icon-enquiry::after {
  right: 10px;
  bottom: 10px;
  width: 10px;
  height: 2px;
  background: #f4b63b;
  transform: rotate(45deg);
}

.icon-track::before {
  inset: 10px 13px 14px;
  border: 2px solid #7da2ff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.icon-track::after {
  left: 20px;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7da2ff;
}

.icon-complaint::before {
  left: 13px;
  right: 13px;
  top: 10px;
  bottom: 12px;
  border: 2px solid #ff777c;
  border-radius: 7px;
}

.icon-complaint::after {
  left: 21px;
  top: 16px;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: #ff777c;
  box-shadow: 0 18px 0 #ff777c;
}

.icon-contact::before {
  left: 12px;
  top: 12px;
  width: 22px;
  height: 18px;
  border: 2px solid #86eee7;
  border-radius: 5px;
}

.icon-contact::after {
  left: 14px;
  top: 15px;
  width: 18px;
  height: 10px;
  border-bottom: 2px solid #86eee7;
  transform: rotate(-24deg);
}

.icon-login::before {
  left: 13px;
  top: 19px;
  width: 20px;
  height: 15px;
  border-radius: 5px;
  background: #7da2ff;
}

.icon-login::after {
  left: 17px;
  top: 10px;
  width: 12px;
  height: 13px;
  border: 2px solid #7da2ff;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.icon-partner::before {
  left: 12px;
  top: 13px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f4b63b;
  box-shadow: 13px 0 0 #f4b63b, 7px 15px 0 #1fa097;
}

.public-card-content em {
  margin-top: 8px;
  padding: 0;
  background: transparent;
  color: #f4b63b;
  text-transform: none;
  font-size: 13px;
}

.public-card:focus-visible,
.public-card:hover {
  transform: translateY(-4px);
}

.public-help-section {
  display: grid;
  gap: 18px;
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(16, 36, 55, 0.72), rgba(8, 19, 33, 0.62));
}

.public-help-section h2 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.12;
}

.public-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.public-help-grid article {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(234, 242, 255, 0.06);
}

.public-help-grid strong {
  color: #eaf2ff;
}

.public-help-grid span {
  color: #9fb0c8;
  font-size: 13px;
}

.public-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.public-modal.hidden {
  display: none;
}

.public-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 18, 0.72);
  backdrop-filter: blur(8px);
}

.public-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 26px;
  padding: 26px;
  background:
    linear-gradient(150deg, rgba(16, 36, 55, 0.98), rgba(8, 19, 33, 0.98)),
    radial-gradient(circle at 88% 10%, rgba(244, 182, 59, 0.12), transparent 30%);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.46);
  color: #eaf2ff;
}

.public-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid rgba(159, 176, 200, 0.26);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(234, 242, 255, 0.06);
  color: #eaf2ff;
  font-weight: 800;
}

.public-modal .public-panel-card {
  padding-top: 28px;
}

.public-modal .public-info-grid span,
.public-modal .public-form-message,
.public-modal .public-upload-placeholder {
  border: 0;
  background: rgba(234, 242, 255, 0.065);
}

.os-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
}

.os-modal.hidden {
  display: none;
}

.os-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
}

.os-modal-card {
  position: relative;
  width: min(780px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.os-modal-head,
.os-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-line);
}

.os-modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.os-modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--panel-line);
  border-bottom: 0;
  flex-wrap: wrap;
}

.lead-request-review-body {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.lead-request-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lead-request-review-field,
.lead-request-review-note {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.lead-request-review-field span,
.lead-request-review-note span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lead-request-review-field strong,
.lead-request-review-note p {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-rail-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

@media (min-width: 761px) {
  .app-shell:has(.sidebar:hover),
  .app-shell:has(.sidebar:focus-within),
  body.sidebar-resizing .app-shell {
    grid-template-columns: var(--sidebar-expanded-width) minmax(0, 1fr);
  }
}

.sidebar {
  width: var(--sidebar-rail-width);
  grid-row: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 150;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--panel-line);
  color: #fff;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  box-shadow: 12px 0 28px rgba(0, 0, 0, 0);
  transition: width 180ms ease, padding 180ms ease, opacity 160ms ease, box-shadow 180ms ease;
}

.sidebar:hover,
.sidebar:focus-within,
body.sidebar-resizing .sidebar {
  width: var(--sidebar-expanded-width);
  padding: 12px 10px;
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.34);
}

.sidebar .nav-item,
.sidebar .sidebar-footer {
  transition: opacity 140ms ease, transform 140ms ease;
}

.sidebar:not(:hover):not(:focus-within) .nav-item,
.sidebar:not(:hover):not(:focus-within) .sidebar-footer {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.app-shell.sidebar-hidden {
  --sidebar-width: 0px;
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-shell.sidebar-hidden .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
}

.app-shell.sidebar-hidden .sidebar-drag {
  width: 0;
  border: 0;
  pointer-events: none;
}

.app-shell.detail-hidden .detail-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-drag {
  grid-row: 1 / -1;
  display: none;
  width: 8px;
  background: #0a1a2a;
  border-left: 1px solid #11253a;
  border-right: 1px solid #11253a;
  cursor: col-resize;
}

.sidebar-drag:hover,
.sidebar-drag:focus-visible,
body.sidebar-resizing .sidebar-drag {
  background: var(--blue);
}

body.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

.sidebar-reveal,
.detail-reveal {
  position: fixed;
  top: 12px;
  z-index: 125;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.sidebar-reveal {
  left: 12px;
}

.detail-reveal {
  right: 12px;
}

.brand {
  display: none;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.brand img {
  width: 46px;
  height: auto;
  background: #fff;
  border-radius: 6px;
  padding: 5px;
}

.sidebar:hover .brand img,
.sidebar:focus-within .brand img,
body.sidebar-resizing .brand img {
  width: 116px;
}

.brand span {
  font-weight: 800;
  color: #dff5ef;
}

.sidebar-control {
  margin-left: auto;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.nav-list::-webkit-scrollbar {
  width: 6px;
}

.nav-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
}

.nav-item {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #c9d7e5;
  text-align: left;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 700;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: #fff;
}

.nav-item.hidden {
  display: none;
}

.module-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.module-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--panel-elevated);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.module-tab:hover,
.module-tab.active {
  border-color: rgba(56, 216, 154, 0.45);
  background: rgba(56, 216, 154, 0.12);
  color: var(--text-primary);
}

.module-tab.hidden {
  display: none;
}

.mobile-module-strip,
.mobile-module-menu {
  display: none;
}

.mobile-module-menu {
  margin: 0 0 16px;
  gap: 14px;
}

.mobile-module-menu-head,
.mobile-module-strip {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mobile-module-menu-head {
  display: flex;
  padding: 16px;
}

.mobile-module-menu-head h2 {
  font-size: 19px;
}

.mobile-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mobile-module-tile {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--panel), var(--panel-elevated));
  color: var(--text);
  padding: 16px;
  text-align: left;
  box-shadow: var(--shadow);
}

.mobile-module-tile strong {
  font-size: 16px;
}

.mobile-module-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mobile-module-tile.active,
.mobile-module-tile:hover {
  border-color: rgba(56, 216, 154, 0.55);
  background: linear-gradient(135deg, rgba(56, 216, 154, 0.16), var(--panel));
}

.sidebar-footer {
  margin-top: auto;
  display: none;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  color: #cfe4df;
  font-size: 12px;
  background: #071420;
}

.sidebar-footer strong {
  color: #fff;
}

.main {
  grid-column: 2;
  grid-row: 2;
  padding: 0 24px 24px;
  overflow: visible;
}

.module-placeholder {
  display: block;
}

.planned-card {
  padding: 24px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--panel), var(--panel-elevated));
  box-shadow: var(--shadow);
}

.planned-card h2 {
  margin: 6px 0 8px;
}

.planned-card p:last-child {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 240;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-width: 0;
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(30, 51, 71, 0.5);
  background: var(--bg);
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title img {
  width: 48px;
  height: auto;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
}

.topbar-title > div {
  min-width: 0;
}

.topbar-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 900;
  color: #38d89a;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.topbar-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.topbar-actions > * {
  flex: 0 0 auto;
}

.notification-menu {
  position: relative;
  z-index: 320;
  max-width: 100%;
  min-width: 0;
}

.notification-button {
  position: relative;
  padding-right: 34px;
}

.notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  max-height: 460px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 340;
}

.notification-panel header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--panel-line);
  background: var(--panel);
  min-width: 0;
  z-index: 1;
}

.notification-panel header h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.notification-list {
  display: grid;
  gap: 0;
  min-width: 0;
  overflow-x: hidden;
}

.notification-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 0;
  border-bottom: 1px solid var(--panel-line);
  padding: 12px;
  text-align: left;
  background: transparent;
  color: var(--text);
  overflow-x: hidden;
  white-space: normal;
}

.notification-item:hover,
.notification-item:focus-visible {
  background: var(--panel-soft);
}

.notification-item.unread {
  background: rgba(23, 116, 242, 0.12);
}

.notification-item span,
.notification-item small,
.notification-empty {
  color: var(--muted);
}

.notification-item strong,
.notification-item span,
.notification-item small,
.notification-empty {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.notification-item small {
  line-height: 1.35;
}

.notification-empty {
  padding: 16px;
  font-size: 13px;
  font-weight: 800;
}

.theme-toggle {
  min-width: 72px;
}

.permission-disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.35);
}

.role-placeholder {
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 8px;
  padding: 14px 16px;
  color: #bfdbfe;
  background: rgba(14, 165, 233, 0.1);
  font-weight: 800;
}

.staff-my-work-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
}

.staff-monitor-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
}

.staff-monitor-note {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.staff-monitor-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.staff-monitor-list,
.staff-monitor-detail,
.staff-monitor-jobs {
  display: grid;
  gap: 10px;
}

.staff-monitor-person {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(30, 51, 71, 0.85);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: #091826;
  text-align: left;
}

.staff-monitor-person:hover,
.staff-monitor-person.active {
  border-color: rgba(56, 216, 154, 0.55);
  background: rgba(56, 216, 154, 0.12);
}

.staff-monitor-person span,
.staff-monitor-person em,
.staff-monitor-card span,
.staff-monitor-profile span,
.staff-monitor-profile em,
.staff-monitor-job span,
.staff-monitor-job small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.staff-monitor-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.staff-monitor-profile,
.staff-monitor-card,
.staff-monitor-job {
  border: 1px solid rgba(30, 51, 71, 0.85);
  border-radius: 8px;
  padding: 12px;
  background: #091826;
}

.staff-monitor-profile,
.staff-monitor-card {
  display: grid;
  gap: 8px;
}

.staff-monitor-profile strong,
.staff-monitor-card strong {
  font-size: 24px;
  line-height: 1;
}

.staff-monitor-job {
  display: grid;
  grid-template-columns: minmax(200px, 1.3fr) minmax(150px, 1fr) minmax(120px, 0.75fr) minmax(100px, 0.65fr) minmax(150px, 1fr) minmax(90px, 0.55fr) auto;
  gap: 10px;
  align-items: center;
}

.staff-monitor-job > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.staff-monitor-job strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-work-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.my-work-card {
  display: grid;
  gap: 10px;
  min-height: 104px;
  border: 1px solid rgba(30, 51, 71, 0.85);
  border-radius: 8px;
  padding: 14px;
  background: #091826;
}

.my-work-card span,
.my-work-meta small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.my-work-card strong {
  font-size: 30px;
  line-height: 1;
}

.my-work-list,
.my-work-stage-list {
  display: grid;
  gap: 10px;
}

.my-work-stage {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(30, 51, 71, 0.85);
  border-radius: 8px;
  padding: 12px;
  background: #081522;
}

.my-work-stage header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.my-work-stage h3 {
  margin: 0;
}

.my-work-stage header strong {
  min-width: 32px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(23, 116, 242, 0.2);
}

.my-work-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(120px, 0.8fr) minmax(110px, 0.65fr) minmax(100px, 0.65fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(30, 51, 71, 0.85);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: #0a1b2b;
  text-align: left;
}

.my-work-item:hover {
  border-color: rgba(23, 116, 242, 0.76);
  background: rgba(23, 116, 242, 0.12);
}

.my-work-main,
.my-work-meta {
  display: grid;
  gap: 5px;
}

.my-work-main strong,
.my-work-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-work-main small {
  color: var(--muted);
  font-size: 11px;
}

.my-work-action {
  justify-self: end;
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  color: #bfdbfe;
  background: rgba(14, 165, 233, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.my-work-empty {
  border: 1px dashed rgba(148, 168, 188, 0.35);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

/* Shared components */
.primary-button,
.ghost-button,
.icon-button,
.panel-hide-button {
  border-radius: 8px;
  min-height: 40px;
  border: 1px solid var(--panel-line);
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.ghost-button,
.icon-button,
.panel-hide-button {
  background: var(--panel);
  color: var(--text);
}

.date-button {
  color: #d8e7f7;
}

.full-button {
  width: 100%;
  margin-top: 16px;
}

.ceo-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ceo-kpis,
.dashboard-grid,
.quick-actions-panel {
  display: none;
}

.metric,
.dashboard-panel,
.pipeline-panel,
.list-panel,
.data-panel,
.quick-actions-panel,
.staff-my-work-panel,
.daily-review-panel,
.pending-work-panel,
.staff-report-panel,
.document-control-panel,
.management-insights-panel,
.crm-followup-panel,
.overdue-jobs-panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 116px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-ring {
  width: 76px;
  min-width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    conic-gradient(var(--ring-color, var(--blue)) 0 var(--ring-value, 0%), rgba(255, 255, 255, 0.08) var(--ring-value, 0%) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.metric-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--panel);
}

.metric-ring span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 900;
  font-size: 17px;
  line-height: 1;
  text-align: center;
  max-width: 58px;
  overflow-wrap: anywhere;
}

.blue-ring { --ring-color: #1774f2; }
.orange-ring { --ring-color: #f59e0b; }
.green-ring { --ring-color: #20c863; }
.yellow-ring { --ring-color: #eab308; }
.red-ring { --ring-color: #ef4444; }
.purple-ring { --ring-color: #8b5cf6; }

.metric span,
.mini-card span,
.progress-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric small {
  display: block;
  margin-top: 12px;
  color: #43d06d;
  font-size: 11px;
  font-weight: 800;
}

.data-panel {
  padding: 16px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.small-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(32, 200, 99, 0.12);
  color: #5be28f;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(440px, 1.45fr) minmax(320px, 1fr) minmax(280px, 0.8fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-panel,
.pipeline-panel,
.quick-actions-panel,
.staff-my-work-panel,
.pending-work-panel,
.staff-report-panel,
.document-control-panel,
.management-insights-panel,
.crm-followup-panel,
.overdue-jobs-panel {
  padding: 16px;
}

.panel-large {
  grid-row: span 2;
}

.pipeline-table-wrap,
.table-wrap {
  overflow: auto;
}

.compact-work-queue table {
  min-width: 1320px;
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-elevated);
}

.bulk-action-bar.hidden {
  display: none;
}

.bulk-action-bar strong {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.bulk-action-bar select {
  min-width: 150px;
}

.bulk-action-bar textarea {
  min-width: 220px;
  min-height: 38px;
  resize: vertical;
}

.pipeline-table,
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table {
  min-width: 1560px;
}

.workspace table {
  min-width: 1180px;
}

.pipeline-table {
  min-width: 720px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0a1826;
  color: #9fb4c9;
  text-align: left;
  font-size: 12px;
  padding: 11px 10px;
  border-bottom: 1px solid var(--panel-line);
}

td {
  padding: 10px;
  border-bottom: 1px solid rgba(30, 51, 71, 0.82);
  vertical-align: middle;
  white-space: nowrap;
}

tbody tr {
  background: transparent;
}

tbody tr:hover,
tbody tr.selected,
.pipeline-row.active-row {
  background: rgba(23, 116, 242, 0.12);
}

.row-index {
  display: inline-flex;
  width: 24px;
  color: var(--muted);
}

.done-text { color: var(--green); font-weight: 900; }
.processing-text { color: var(--yellow); font-weight: 900; }
.pending-text { color: var(--red); font-weight: 900; }

.stacked-bar {
  height: 10px;
  min-width: 92px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: #1b2c40;
}

.bar-done { background: var(--green); }
.bar-processing { background: var(--yellow); }
.bar-pending { background: var(--red); }

.finance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mini-card {
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
}

.mini-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.progress-block {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.progress-block div:first-child {
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #1b2c40;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.alert-list,
.quality-list,
.activity-list,
.status-legend {
  display: grid;
  gap: 10px;
}

.alert-item,
.activity-item,
.legend-row,
.quality-row {
  padding: 11px 0;
  border-bottom: 1px solid rgba(30, 51, 71, 0.82);
}

.alert-item,
.legend-row,
.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.alert-item strong {
  min-width: 34px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.alert-item.red { color: #ff7d7d; }
.alert-item.orange { color: #f9b44c; }
.alert-item.yellow { color: #f4d04d; }
.alert-item.purple { color: #b69bff; }
.alert-item.blue { color: #7ab5ff; }
.alert-item.green { color: #5be28f; }

.status-chart-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--green) 0 0, var(--blue) 0 0, var(--orange) 0 100%);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: var(--panel);
}

.donut span,
.donut small {
  position: relative;
  z-index: 1;
}

.donut span {
  font-size: 28px;
  font-weight: 900;
}

.donut small {
  margin-top: 32px;
  color: var(--muted);
}

.legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-row span {
  flex: 1;
  color: var(--muted);
}

.quality-row {
  display: grid;
  gap: 9px;
}

.quality-row div:first-child {
  display: flex;
  justify-content: space-between;
}

.quality-row span,
.activity-item span {
  color: var(--muted);
  font-size: 12px;
}

.activity-item div {
  display: grid;
  gap: 4px;
}

.activity-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.quick-actions-panel {
  margin-bottom: 12px;
}

.pending-work-panel {
  margin-bottom: 12px;
}

.daily-review-panel {
  margin-bottom: 12px;
}

.daily-review-cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
  padding: 0 16px 14px;
}

.daily-review-card {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 12px;
}

.daily-review-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.daily-review-card strong {
  color: var(--text);
  font-size: 23px;
  line-height: 1.1;
}

.daily-review-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.daily-review-card.red strong {
  color: #ff6b6b;
}

.daily-review-card.orange strong {
  color: #f8c14a;
}

.daily-review-card.green strong {
  color: #5be28f;
}

.daily-review-card.blue strong {
  color: #7ab5ff;
}

.daily-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.daily-review-list-panel {
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #071523;
  overflow: hidden;
}

.daily-review-list-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--panel-line);
}

.daily-review-list-panel h3 {
  margin: 0;
  font-size: 13px;
}

.daily-review-list-panel header span {
  color: var(--text);
  font-weight: 900;
}

.daily-review-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow: auto;
  padding: 10px;
}

.daily-review-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 10px;
  cursor: pointer;
}

.daily-review-item:hover {
  border-color: rgba(23, 116, 242, 0.78);
  background: rgba(23, 116, 242, 0.12);
}

.daily-review-item strong {
  color: var(--text);
  font-size: 13px;
}

.daily-review-item small,
.daily-review-item em,
.daily-review-empty {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.daily-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.daily-review-open,
.daily-review-mark-done {
  min-height: 32px;
  padding: 6px 10px;
}

.daily-review-empty {
  padding: 12px;
}

.staff-report-panel {
  margin-bottom: 12px;
}

.document-control-panel {
  margin-bottom: 12px;
}

.documents-v2-panel {
  margin-bottom: 12px;
  padding: 20px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.documents-v2-note,
.document-v2-note,
.uploaded-files-placeholder {
  color: var(--text-secondary);
  line-height: 1.5;
}

.documents-v2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.documents-v2-grid article {
  padding: 13px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-elevated);
  color: var(--text-primary);
  font-weight: 800;
}

.daily-report-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
  padding: 20px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.daily-report-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-report-toolbar label {
  display: grid;
  gap: 6px;
}

.daily-report-toolbar span,
.daily-report-fallback span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.daily-report-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.daily-report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.daily-report-summary article {
  padding: 14px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-elevated);
}

.daily-report-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.daily-report-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 28px;
}

.daily-report-preview {
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-elevated);
  color: var(--text);
  padding: 16px;
  min-height: 240px;
}

.daily-report-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  line-height: 1.55;
}

.daily-report-fallback {
  display: grid;
  gap: 8px;
}

.daily-report-fallback.hidden {
  display: none;
}

.management-insights-panel {
  margin-bottom: 12px;
}

.crm-followup-panel {
  margin-bottom: 12px;
}

.overdue-jobs-panel {
  margin-bottom: 12px;
}

.staff-workload-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 10px;
}

.staff-workload-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  color: var(--text);
  text-align: left;
  padding: 12px;
}

.staff-workload-card:hover,
.staff-workload-card.active {
  border-color: rgba(23, 116, 242, 0.78);
  background: rgba(23, 116, 242, 0.12);
}

.staff-workload-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.staff-workload-card strong {
  font-size: 30px;
  line-height: 1;
}

.staff-workload-card small,
.staff-workload-card em,
.staff-workload-card i,
.staff-empty {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.staff-workload-card em {
  color: #ffbf75;
}

.staff-workload-card i {
  overflow-wrap: anywhere;
}

.staff-empty {
  padding: 14px 12px;
}

.document-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
}

.document-control-card {
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 12px;
}

.document-control-card span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.document-control-card strong {
  color: #ff8a8a;
  font-size: 28px;
  line-height: 1;
}

.document-control-card small,
.document-control-card em,
.document-empty {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.document-control-card em {
  overflow-wrap: anywhere;
}

.document-empty {
  padding: 14px 12px;
}

.management-insights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
}

.management-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 12px;
}

.management-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.management-card strong {
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.08;
}

.management-card small,
.management-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.management-card em {
  color: #cfe4df;
  line-height: 1.35;
}

.management-card.red {
  border-color: rgba(239, 68, 68, 0.42);
}

.management-card.red strong {
  color: #ff8a8a;
}

.management-card.orange strong {
  color: #ffbf75;
}

.management-card.green strong {
  color: #5be28f;
}

.management-card.blue strong {
  color: #7ab5ff;
}

.crm-followup-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.crm-followup-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 108px minmax(150px, 0.9fr) minmax(220px, 1.1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  color: var(--text);
  text-align: left;
  padding: 10px;
  cursor: pointer;
}

.crm-followup-row:hover {
  border-color: rgba(23, 116, 242, 0.78);
  background: rgba(23, 116, 242, 0.12);
}

.crm-followup-row strong,
.crm-followup-row small,
.crm-followup-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-followup-row small,
.crm-followup-row em,
.crm-empty {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.crm-followup-row em {
  white-space: normal;
  line-height: 1.35;
}

.crm-mark-done {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.crm-empty {
  padding: 14px 12px;
}

.pending-work-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
}

.pending-department {
  min-height: 210px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  overflow: hidden;
}

.pending-department header {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--panel-line);
}

.pending-department h3 {
  margin: 0;
  font-size: 13px;
}

.pending-department header strong {
  min-width: 30px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(23, 116, 242, 0.16);
  color: #7ab5ff;
  font-size: 12px;
}

.pending-list {
  max-height: 310px;
  overflow: auto;
}

.pending-department.expanded .pending-list {
  max-height: 680px;
}

.pending-work-item {
  width: 100%;
  border-bottom: 1px solid rgba(30, 51, 71, 0.72);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.pending-work-item:hover {
  background: rgba(23, 116, 242, 0.12);
}

.pending-work-summary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
}

.pending-work-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pending-work-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.pending-work-summary span {
  color: var(--muted);
  font-size: 11px;
}

.pending-work-summary em {
  min-width: 78px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.pending-work-summary em.pending {
  background: rgba(234, 179, 8, 0.16);
  color: #f4d04d;
}

.pending-work-summary em.processing {
  background: rgba(23, 116, 242, 0.16);
  color: #7ab5ff;
}

.pending-work-summary em.rejected {
  background: rgba(239, 68, 68, 0.16);
  color: #ff8a8a;
}

.pending-empty,
.pending-more {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pending-more {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--panel-line);
  background: var(--panel-elevated);
  color: #7ab5ff;
  text-align: left;
  cursor: pointer;
  position: sticky;
  bottom: 0;
}

.danger-pill {
  background: rgba(239, 68, 68, 0.14);
  color: #ff8a8a;
}

.success-pill {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.warning-pill {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

.overdue-jobs-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.overdue-job-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 82px minmax(220px, 1.4fr) repeat(3, minmax(110px, 0.65fr)) 104px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(30, 51, 71, 0.82);
  border-radius: 8px;
  background: #0a1826;
  color: var(--text);
  text-align: left;
  padding: 10px;
}

.overdue-job-row:hover {
  border-color: rgba(23, 116, 242, 0.7);
  background: rgba(23, 116, 242, 0.12);
}

.overdue-delay {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.16);
  color: #ff8a8a;
  font-size: 12px;
  font-weight: 900;
}

.overdue-main,
.overdue-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.overdue-main strong,
.overdue-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overdue-main small,
.overdue-meta small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.overdue-empty {
  padding: 16px;
  border: 1px solid rgba(30, 51, 71, 0.82);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.quick-action {
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
}

.blue-action { background: #154fa5; }
.green-action { background: #0b6d43; }
.orange-action { background: #884b14; }
.purple-action { background: #69339c; }
.red-action { background: #8f2228; }

.workspace {
  display: grid;
  gap: 16px;
}

.list-panel {
  overflow: hidden;
}

.list-head {
  padding: 16px 16px 0;
}

.project-pipeline-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 12px 14px 2px;
  max-width: 100%;
  max-height: 114px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.project-pipeline-chip {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  max-width: 178px;
  border: 1px solid rgba(80, 204, 255, 0.36);
  border-radius: 8px;
  padding: 5px 9px;
  color: #e7f8ff;
  background:
    linear-gradient(135deg, rgba(24, 106, 164, 0.42), rgba(12, 41, 66, 0.88)),
    rgba(8, 21, 34, 0.92);
  box-shadow: 0 8px 20px rgba(9, 116, 176, 0.12);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.project-pipeline-chip span {
  min-width: 0;
  overflow: hidden;
  color: #cdeffc;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-pipeline-chip strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
}

.project-pipeline-chip-total {
  border-color: rgba(105, 224, 255, 0.64);
  background:
    linear-gradient(135deg, rgba(20, 148, 204, 0.72), rgba(18, 73, 119, 0.94)),
    rgba(7, 30, 48, 0.94);
  box-shadow: 0 8px 24px rgba(32, 196, 255, 0.2);
}

@media (max-width: 760px) {
  .project-pipeline-strip {
    gap: 6px;
    padding: 10px 12px 0;
    max-height: 108px;
  }

  .project-pipeline-chip {
    max-width: calc(50% - 3px);
    flex: 1 1 calc(50% - 3px);
    padding: 5px 8px;
    font-size: 11px;
  }

  .project-pipeline-chip strong {
    font-size: 12px;
  }
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--panel-line);
}

.work-queue-filters {
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  margin: 0 0 12px;
  background: rgba(10, 24, 38, 0.72);
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--panel-line);
  background: #071420;
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--text);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

textarea {
  resize: vertical;
}

.import-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 210px;
  gap: 14px;
  align-items: end;
}

.remote-import-preview {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--panel-line);
  padding-top: 16px;
}

.remote-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.remote-import-note {
  margin: 0;
  color: #f4d04d;
  font-size: 13px;
  font-weight: 900;
}

.danger-text {
  color: #ff8a8a;
}

.dry-run-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 14px;
}

.dry-run-conflicts {
  display: grid;
  gap: 10px;
}

.dry-run-list {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(30, 51, 71, 0.82);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dry-run-list strong {
  color: var(--text);
}

.danger-list {
  border-color: rgba(239, 68, 68, 0.72);
  background: rgba(239, 68, 68, 0.1);
  color: #ffb4b4;
}

.validation-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.validation-metric {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 12px;
}

.validation-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.validation-metric strong {
  color: var(--text);
  font-size: 24px;
}

.validation-section {
  display: grid;
  gap: 10px;
}

.compact-head {
  margin: 0;
}

.compact-head h3 {
  margin: 0;
  font-size: 16px;
}

.validation-table-wrap {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
}

.validation-table th,
.validation-table td {
  white-space: nowrap;
}

.validation-table td {
  font-size: 12px;
}

.validation-blocker td {
  background: rgba(239, 68, 68, 0.1);
}

.validation-warning td {
  background: rgba(234, 179, 8, 0.08);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
}

.table-wrap {
  max-height: 52vh;
}

.customer-cell {
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.empty-row {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  height: 96px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.pending { background: rgba(234, 179, 8, 0.16); color: #f4d04d; }
.status-pill.processing { background: rgba(23, 116, 242, 0.16); color: #7ab5ff; }
.status-pill.done { background: rgba(32, 200, 99, 0.16); color: #5be28f; }
.status-pill.rejected { background: rgba(239, 68, 68, 0.16); color: #ff8a8a; }
.status-pill.blank { background: rgba(148, 168, 188, 0.12); color: #9fb4c9; }
.status-pill.other,
.status-pill.not-required { background: rgba(139, 92, 246, 0.16); color: #b69bff; }

.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.priority-pill.high {
  color: #ffd7d9;
  background: rgba(212, 32, 39, 0.22);
}

.priority-pill.medium {
  color: #ffe3a3;
  background: rgba(244, 182, 59, 0.2);
}

.priority-pill.low {
  color: #b9f7df;
  background: rgba(25, 195, 125, 0.18);
}

.lifecycle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
  white-space: nowrap;
}

.lifecycle-pill.hold {
  background: rgba(234, 179, 8, 0.16);
  color: #f4d04d;
}

.lifecycle-pill.dropped {
  background: rgba(239, 68, 68, 0.16);
  color: #ff8a8a;
}

.priority-select {
  min-width: 92px;
  min-height: 34px;
  padding: 5px 28px 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: var(--panel-elevated);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.priority-editor {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.priority-editor.hidden {
  display: none;
}

.priority-editor label {
  display: grid;
  gap: 6px;
}

.priority-editor span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.priority-meta {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: 28px;
  background: rgba(2, 8, 20, 0.68);
  border: 0;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.detail-panel > .detail-content,
.detail-panel > #projectForm,
.detail-panel > .detail-empty {
  width: min(90vw, 1180px);
  max-height: min(90vh, 920px);
  overflow: auto;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: #071420;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  padding: 22px;
}

.panel-hide-button {
  display: none;
}

.detail-empty {
  min-height: 260px;
  display: grid;
  align-content: center;
  color: var(--muted);
}

.detail-empty h2 {
  color: var(--text);
  margin-bottom: 6px;
}

.hidden {
  display: none;
}

.detail-head {
  position: sticky;
  top: -22px;
  z-index: 20;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin: -22px -22px 18px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--panel-line);
  background: #071420;
}

#detailContent .detail-head {
  padding-right: 22px;
}

#closeDetail {
  position: static;
  z-index: 21;
  min-width: 40px;
  min-height: 40px;
  box-shadow: var(--shadow);
}

.readonly-notice {
  margin-bottom: 16px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: #f4d04d;
  padding: 11px 12px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.workflow-save-button {
  width: 100%;
  margin-top: 12px;
}

.workflow-reason {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.workflow-reason span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-save-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.remote-readonly input:disabled,
.remote-readonly select:disabled,
.remote-readonly textarea:disabled,
.remote-readonly button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  color: #9fb4c9;
  border-color: rgba(148, 168, 188, 0.22);
  background: rgba(7, 20, 32, 0.72);
}

.remote-readonly .document-check {
  opacity: 0.72;
}

.remote-readonly.document-editable .document-check {
  opacity: 1;
}

.remote-readonly .document-check input:disabled + span {
  color: #9fb4c9;
}

.detail-title-input {
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.detail-title-input:focus {
  padding: 0 8px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #071420;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}

.detail-facts label {
  padding: 12px;
  display: grid;
  gap: 5px;
  border-right: 1px solid var(--panel-line);
  border-bottom: 1px solid var(--panel-line);
}

.detail-facts label:nth-child(2n),
.detail-facts label:last-child {
  border-right: 0;
}

.detail-facts label:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.detail-facts span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.detail-facts input {
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.detail-facts input:focus {
  padding: 0 8px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #071420;
}

.project-summary-section {
  border-top: 0;
  padding-top: 0;
}

.detail-summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: -6px;
}

.detail-summary-strip span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
}

.detail-summary-strip strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-summary-strip em {
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.core-edit-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 8px;
  padding: 11px;
  background: rgba(14, 165, 233, 0.1);
}

.core-edit-actions span {
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.core-edit-actions.hidden {
  display: none;
}

.detail-section {
  border-top: 1px solid var(--panel-line);
  padding-top: 16px;
  margin-top: 16px;
}

.stage-editors {
  display: grid;
  gap: 10px;
}

.stage-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: center;
}

.stage-editor strong {
  font-size: 13px;
}

.document-checklist {
  display: grid;
  gap: 8px;
}

.document-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
}

.document-check.optional {
  opacity: 0.64;
}

.document-check input {
  min-height: 18px;
}

.document-check span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.document-check em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.followup-editor {
  display: grid;
  gap: 10px;
}

.followup-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.workflow-history {
  display: grid;
  gap: 8px;
}

.workflow-history-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 10px;
}

.workflow-history-item strong {
  color: #bfdbfe;
  font-size: 12px;
}

.workflow-history-item span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.workflow-history-item em {
  color: #f4d04d;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.workflow-history-item small,
.workflow-history-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.workflow-history-empty {
  border: 1px dashed rgba(148, 168, 188, 0.35);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.followup-history-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 9px;
}

.followup-history-item strong {
  color: #7ab5ff;
  font-size: 12px;
}

.followup-history-item span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.followup-history-item em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.work-completion-summary,
.work-completion-status,
.completion-request-list {
  display: grid;
  gap: 8px;
}

.work-completion-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin: 0;
}

.completion-request-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 9px;
}

.completion-request-item strong {
  color: #7ab5ff;
  font-size: 12px;
}

.completion-request-item span,
.completion-request-item em,
.completion-request-item small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.stage-approval-panel {
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
  margin: 0 0 14px;
}

.work-queue-approval-summary {
  margin: 0 0 12px;
}

.approval-summary-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 38px;
  padding: 8px 12px;
  text-align: left;
}

.approval-summary-button span {
  color: var(--text);
  font-weight: 900;
}

.approval-summary-button strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.compact-head h3 {
  margin: 0;
  font-size: 1rem;
}

.lead-approval-head {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-line);
}

.lead-approval-head span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.stage-approval-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.stage-approval-tab {
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  min-height: 34px;
  padding: 7px 11px;
}

.stage-approval-tab span {
  margin-left: 6px;
  color: var(--accent);
}

.stage-approval-tab.active,
.stage-approval-tab:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--panel-line));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-soft));
  color: var(--text);
}

.stage-approval-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stage-approval-grid.compact-approval-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.stage-approval-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.stage-approval-column h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
}

.stage-approval-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
  min-width: 0;
}

.stage-approval-card.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 9px 10px;
}

.stage-approval-card strong,
.stage-approval-card span,
.stage-approval-card em,
.stage-approval-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-approval-card strong {
  color: var(--text);
  font-size: 0.9rem;
}

.stage-approval-card span,
.stage-approval-card em,
.stage-approval-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.stage-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.stage-approval-actions button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 0.76rem;
}

#stageCompletionRequestSection {
  padding: 12px;
}

#stageCompletionRequestSection h3 {
  margin-bottom: 8px;
}

#stageCompletionRequestSection .work-completion-summary {
  margin-bottom: 8px;
}

#stageCompletionRequestSection textarea {
  min-height: 70px;
}

.danger-action {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--panel-line));
  color: var(--danger);
}

.followup-mark-done {
  justify-self: start;
  min-height: 34px;
  padding: 7px 10px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-status-section {
  border-top: 0;
  margin-top: 18px;
  padding-top: 0;
}

.toast {
  position: fixed;
  right: 22px;
  top: 22px;
  max-width: min(460px, calc(100vw - 44px));
  background: #0a1826;
  color: #fff;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  z-index: 10000;
}

.important-toast {
  border-color: #f59e0b;
  background: #201406;
  color: #fff7ed;
}

/* Light theme overrides */
[data-theme="light"] body,
[data-theme="light"] .auth-gate,
[data-theme="light"] .topbar {
  background: var(--bg);
  color: var(--text);
}

[data-theme="light"] .topbar {
  border-bottom-color: var(--panel-line);
}

[data-theme="light"] .topbar-subtitle,
[data-theme="light"] label span,
[data-theme="light"] .muted {
  color: var(--muted);
}

[data-theme="light"] .eyebrow {
  color: var(--green-dark);
}

[data-theme="light"] .sidebar {
  background: var(--sidebar);
  color: var(--text);
  border-right-color: var(--panel-line);
}

[data-theme="light"] .sidebar-drag {
  background: #e8f0f7;
  border-color: var(--panel-line);
}

[data-theme="light"] .brand img {
  border: 1px solid var(--panel-line);
}

[data-theme="light"] .brand span,
[data-theme="light"] .sidebar-footer strong {
  color: var(--text);
}

[data-theme="light"] .nav-item {
  color: var(--text-secondary);
}

[data-theme="light"] .nav-item.active {
  background: var(--blue);
  color: #fff;
}

[data-theme="light"] .module-tabs {
  background: var(--panel);
  border-color: var(--panel-line);
}

[data-theme="light"] .module-tab {
  background: var(--panel-elevated);
  color: var(--text-secondary);
  border-color: var(--soft-border);
}

[data-theme="light"] .module-tab:hover,
[data-theme="light"] .module-tab.active {
  background: #e0f2fe;
  color: #075985;
  border-color: #7dd3fc;
}

[data-theme="light"] .sidebar-footer {
  background: var(--panel-elevated);
  border-color: var(--panel-line);
  color: var(--muted);
}

[data-theme="light"] .auth-card,
[data-theme="light"] .metric,
[data-theme="light"] .dashboard-panel,
[data-theme="light"] .pipeline-panel,
[data-theme="light"] .list-panel,
[data-theme="light"] .data-panel,
[data-theme="light"] .quick-actions-panel,
[data-theme="light"] .staff-my-work-panel,
[data-theme="light"] .daily-review-panel,
[data-theme="light"] .pending-work-panel,
[data-theme="light"] .staff-report-panel,
[data-theme="light"] .document-control-panel,
[data-theme="light"] .documents-v2-panel,
[data-theme="light"] .management-insights-panel,
[data-theme="light"] .crm-followup-panel,
[data-theme="light"] .overdue-jobs-panel,
[data-theme="light"] .detail-panel,
[data-theme="light"] .notification-panel {
  background: var(--panel);
  border-color: var(--panel-line);
  color: var(--text);
}

[data-theme="light"] .detail-panel {
  background: rgba(15, 23, 42, 0.38);
  box-shadow: none;
}

[data-theme="light"] .detail-panel > .detail-content,
[data-theme="light"] .detail-panel > #projectForm,
[data-theme="light"] .detail-panel > .detail-empty {
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

[data-theme="light"] .detail-head {
  background: var(--panel);
}

[data-theme="light"] .metric-ring {
  background:
    conic-gradient(var(--ring-color, var(--blue)) 0 var(--ring-value, 0%), #e8eef6 var(--ring-value, 0%) 100%);
  box-shadow: inset 0 0 0 1px #dbe5ef;
}

[data-theme="light"] .metric-ring span {
  color: var(--text);
}

[data-theme="light"] .metric small {
  color: var(--green-dark);
}

[data-theme="light"] .small-pill {
  background: #dcfce7;
  color: #166534;
}

[data-theme="light"] .danger-pill {
  background: #fee2e2;
  color: #991b1b;
}

[data-theme="light"] .primary-button {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

[data-theme="light"] .ghost-button,
[data-theme="light"] .icon-button,
[data-theme="light"] .panel-hide-button,
[data-theme="light"] .sidebar-reveal,
[data-theme="light"] .detail-reveal,
[data-theme="light"] .date-button {
  background: #ffffff;
  border-color: var(--panel-line);
  color: var(--text);
}

[data-theme="light"] .ghost-button:hover,
[data-theme="light"] .icon-button:hover,
[data-theme="light"] .panel-hide-button:hover,
[data-theme="light"] .notification-item:hover,
[data-theme="light"] .notification-item:focus-visible {
  background: var(--hover-bg);
  border-color: #c5d6e8;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .auth-form input {
  background: var(--input-bg);
  border-color: var(--panel-line);
  color: var(--text);
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] .detail-title-input:focus,
[data-theme="light"] .detail-facts input:focus {
  outline: none;
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #94a3b8;
}

[data-theme="light"] input[type="checkbox"] {
  accent-color: var(--blue);
}

[data-theme="light"] input:disabled,
[data-theme="light"] select:disabled,
[data-theme="light"] textarea:disabled,
[data-theme="light"] button:disabled,
[data-theme="light"] .remote-readonly input:disabled,
[data-theme="light"] .remote-readonly select:disabled,
[data-theme="light"] .remote-readonly textarea:disabled,
[data-theme="light"] .remote-readonly button:disabled {
  cursor: not-allowed;
  opacity: 1;
  background: #f1f5f9;
  border-color: #dbe5ef;
  color: #64748b;
}

[data-theme="light"] .remote-readonly .document-check input:disabled + span {
  color: var(--text-secondary);
}

[data-theme="light"] th {
  background: #f8fafc;
  color: var(--text-secondary);
  border-bottom-color: var(--panel-line);
}

[data-theme="light"] td,
[data-theme="light"] .alert-item,
[data-theme="light"] .activity-item,
[data-theme="light"] .legend-row,
[data-theme="light"] .quality-row {
  border-bottom-color: var(--panel-line-soft);
}

[data-theme="light"] tbody tr:hover,
[data-theme="light"] tbody tr.selected,
[data-theme="light"] .pipeline-row.active-row {
  background: var(--hover-bg);
}

[data-theme="light"] .mini-card,
[data-theme="light"] .daily-review-card,
[data-theme="light"] .daily-review-list-panel,
[data-theme="light"] .daily-review-item,
[data-theme="light"] .staff-workload-card,
[data-theme="light"] .document-control-card,
[data-theme="light"] .management-card,
[data-theme="light"] .crm-followup-row,
[data-theme="light"] .pending-department,
[data-theme="light"] .overdue-job-row,
[data-theme="light"] .dry-run-panel,
[data-theme="light"] .validation-metric,
[data-theme="light"] .workflow-history-item,
[data-theme="light"] .followup-history-item,
[data-theme="light"] .completion-request-item,
[data-theme="light"] .document-check,
[data-theme="light"] .my-work-card,
[data-theme="light"] .my-work-stage,
[data-theme="light"] .my-work-item,
[data-theme="light"] .staff-monitor-person,
[data-theme="light"] .staff-monitor-profile,
[data-theme="light"] .staff-monitor-card,
[data-theme="light"] .staff-monitor-job {
  background: var(--panel-elevated);
  border-color: var(--panel-line);
  color: var(--text);
}

[data-theme="light"] .daily-review-item:hover,
[data-theme="light"] .staff-workload-card:hover,
[data-theme="light"] .staff-workload-card.active,
[data-theme="light"] .crm-followup-row:hover,
[data-theme="light"] .pending-work-item:hover,
[data-theme="light"] .overdue-job-row:hover,
[data-theme="light"] .my-work-item:hover,
[data-theme="light"] .staff-monitor-person:hover,
[data-theme="light"] .staff-monitor-person.active {
  background: var(--hover-bg);
  border-color: #93c5fd;
}

[data-theme="light"] .pending-work-item,
[data-theme="light"] .pending-work-summary {
  background: transparent;
  color: var(--text);
}

[data-theme="light"] .pending-work-item {
  border-bottom-color: var(--panel-line-soft);
}

[data-theme="light"] .pending-department header,
[data-theme="light"] .daily-review-list-panel header,
[data-theme="light"] .filters,
[data-theme="light"] .detail-section {
  border-color: var(--panel-line);
}

[data-theme="light"] .pending-department header strong,
[data-theme="light"] .my-work-stage header strong {
  background: #dbeafe;
  color: #1d4ed8;
}

[data-theme="light"] .pending-work-summary em.pending,
[data-theme="light"] .status-pill.pending {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="light"] .pending-work-summary em.processing,
[data-theme="light"] .status-pill.processing {
  background: #dbeafe;
  color: #1d4ed8;
}

[data-theme="light"] .status-pill.done {
  background: #dcfce7;
  color: #166534;
}

[data-theme="light"] .pending-work-summary em.rejected,
[data-theme="light"] .status-pill.rejected {
  background: #fee2e2;
  color: #991b1b;
}

[data-theme="light"] .overdue-delay {
  background: #fee2e2;
  color: #991b1b;
}

[data-theme="light"] .status-pill.blank {
  background: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .status-pill.other,
[data-theme="light"] .status-pill.not-required {
  background: #ede9fe;
  color: #5b21b6;
}

[data-theme="light"] .priority-pill.high {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="light"] .priority-pill.medium {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="light"] .priority-pill.low {
  background: #dcfce7;
  color: #166534;
}

[data-theme="light"] .lifecycle-pill.hold {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="light"] .lifecycle-pill.dropped {
  background: #fee2e2;
  color: #991b1b;
}

[data-theme="light"] .priority-select {
  background: #ffffff;
  border-color: var(--panel-line);
  color: var(--text);
}

[data-theme="light"] .done-text,
[data-theme="light"] .daily-review-card.green strong,
[data-theme="light"] .management-card.green strong {
  color: var(--green);
}

[data-theme="light"] .processing-text,
[data-theme="light"] .daily-review-card.orange strong,
[data-theme="light"] .staff-workload-card em,
[data-theme="light"] .management-card.orange strong {
  color: var(--orange);
}

[data-theme="light"] .pending-text,
[data-theme="light"] .daily-review-card.red strong,
[data-theme="light"] .document-control-card strong,
[data-theme="light"] .management-card.red strong,
[data-theme="light"] .danger-text {
  color: var(--red);
}

[data-theme="light"] .daily-review-card.blue strong,
[data-theme="light"] .management-card.blue strong,
[data-theme="light"] .workflow-history-item strong,
[data-theme="light"] .followup-history-item strong,
[data-theme="light"] .pending-more {
  color: var(--blue);
}

[data-theme="light"] .stacked-bar,
[data-theme="light"] .progress-track {
  background: #e2e8f0;
}

[data-theme="light"] .detail-title-input,
[data-theme="light"] .detail-facts input {
  background: transparent;
  color: var(--text);
}

[data-theme="light"] .detail-facts {
  background: #ffffff;
  border-color: var(--panel-line);
}

[data-theme="light"] .detail-facts label {
  border-color: var(--panel-line);
}

[data-theme="light"] .detail-summary-strip span,
[data-theme="light"] .documents-v2-grid article,
[data-theme="light"] .work-queue-filters {
  background: var(--panel-elevated);
  border-color: var(--panel-line);
  color: var(--text);
}

[data-theme="light"] .detail-summary-strip strong,
[data-theme="light"] .documents-v2-note,
[data-theme="light"] .document-v2-note,
[data-theme="light"] .uploaded-files-placeholder {
  color: var(--muted);
}

[data-theme="light"] .detail-summary-strip em {
  color: var(--text);
}

[data-theme="light"] .readonly-notice {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

[data-theme="light"] .core-edit-actions {
  background: #eff6ff;
  border-color: #bfdbfe;
}

[data-theme="light"] .core-edit-actions span {
  color: #1d4ed8;
}

[data-theme="light"] .workflow-history-item em,
[data-theme="light"] .remote-import-note {
  color: var(--orange);
}

[data-theme="light"] .workflow-history-empty,
[data-theme="light"] .my-work-empty,
[data-theme="light"] .overdue-empty {
  background: #f8fafc;
  border-color: var(--panel-line);
  color: var(--muted);
}

[data-theme="light"] .alert-item.red { color: #b91c1c; }
[data-theme="light"] .alert-item.orange { color: #c2410c; }
[data-theme="light"] .alert-item.yellow { color: #a16207; }
[data-theme="light"] .alert-item.purple { color: #6d28d9; }
[data-theme="light"] .alert-item.blue { color: #1d4ed8; }
[data-theme="light"] .alert-item.green { color: #15803d; }

[data-theme="light"] .document-check.optional {
  opacity: 0.78;
}

[data-theme="light"] .notification-panel header {
  background: #ffffff;
  border-bottom-color: var(--panel-line);
}

[data-theme="light"] .notification-item {
  background: #ffffff;
  border-bottom-color: var(--panel-line-soft);
  color: var(--text);
}

[data-theme="light"] .notification-item.unread {
  background: #eff6ff;
}

[data-theme="light"] .notification-badge {
  border-color: var(--bg);
  background: var(--red);
  color: #fff;
}

[data-theme="light"] .validation-blocker td,
[data-theme="light"] .danger-list {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

[data-theme="light"] .validation-warning td {
  background: #fffbeb;
}

[data-theme="light"] .toast {
  background: #ffffff;
  color: var(--text);
  border-color: var(--panel-line);
}

[data-theme="light"] .important-toast {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

[data-theme="light"] .blue-action { background: #2563eb; }
[data-theme="light"] .green-action { background: #059669; }
[data-theme="light"] .orange-action { background: #d97706; }
[data-theme="light"] .purple-action { background: #7c3aed; }
[data-theme="light"] .red-action { background: #dc2626; }

@media (max-width: 1400px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 10px 12px;
  }

  .topbar-title {
    gap: 9px;
    flex: 1 1 auto;
  }

  .topbar-title img {
    width: 38px;
    padding: 4px;
  }

  .topbar-title h1 {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 21px;
  }

  .topbar-subtitle {
    display: none;
  }

  .topbar-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    row-gap: 0;
  }

  .topbar-actions .date-button {
    order: 1;
  }

  .topbar-actions .app-language-control {
    order: 2;
  }

  .topbar-actions .notification-menu {
    order: 3;
  }

  .topbar-actions .theme-toggle {
    order: 4;
  }

  .topbar-actions #addProject,
  .topbar-actions #toggleImport,
  .topbar-actions #exportView {
    order: 5;
  }

  .topbar-actions button,
  .topbar-actions .app-language-control {
    min-height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 11.5px;
    white-space: nowrap;
  }

  .topbar-actions .app-language-control {
    gap: 4px;
  }

  .topbar-actions .app-language-control select {
    min-width: 46px;
    padding: 0 20px 0 7px;
    font-size: 11.5px;
  }

  .notification-button {
    padding-right: 28px;
  }

  .ceo-kpis {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(420px, 1.2fr) minmax(280px, 1fr);
  }

  .daily-review-cards {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }

  .daily-review-grid {
    grid-template-columns: 1fr;
  }

  .my-work-item {
    grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(100px, 0.7fr));
  }

  .staff-monitor-summary {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .staff-monitor-job {
    grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(110px, 0.7fr));
  }

  .my-work-action {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 1200px) {
  .topbar h1 {
    font-size: 19px;
    max-width: 220px;
  }

  .topbar-subtitle {
    font-size: 13px;
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
  }

  .topbar-actions .app-language-control,
  .topbar-actions button {
    min-height: 31px;
    padding-left: 7px;
    padding-right: 7px;
    font-size: 11px;
  }

  .topbar-actions .app-language-control {
    min-width: auto;
  }

  .notification-panel {
    left: auto;
    right: 0;
  }
}

@media (max-width: 1024px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  .topbar-actions .notification-menu,
  .topbar-actions .notification-button,
  .topbar-actions .theme-toggle,
  .topbar-actions .date-button,
  .topbar-actions .app-language-control {
    width: auto;
  }

  .topbar-actions .app-language-control {
    justify-content: center;
  }

  .notification-panel {
    left: 0;
    right: auto;
    width: min(380px, calc(100vw - 32px));
  }
}

@media (max-width: 1180px) {
  .public-hero,
  .public-trust-grid,
  .public-help-grid {
    grid-template-columns: 1fr;
  }

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

  .public-hero-panel {
    min-height: 300px;
  }

  .app-shell {
    grid-template-columns: var(--sidebar-rail-width) minmax(0, 1fr);
  }

  .app-shell.sidebar-hidden {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .detail-panel {
    padding: 24px;
  }

  .detail-panel > .detail-content,
  .detail-panel > #projectForm,
  .detail-panel > .detail-empty {
    width: min(92vw, 980px);
    max-height: 88vh;
  }

  .dashboard-grid,
  .quick-actions,
  .my-work-summary,
  .my-work-item,
  .staff-monitor-layout,
  .staff-monitor-summary,
  .staff-monitor-job,
  .daily-review-cards,
  .pending-work-grid,
  .staff-workload-grid,
  .document-control-grid,
  .management-insights-grid,
  .daily-review-grid,
  .crm-followup-row,
  .overdue-job-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .public-header,
  .public-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .public-header-actions,
  .public-hero-actions,
  .public-secondary-actions,
  .public-footer-items {
    display: grid;
    justify-content: stretch;
  }

  .public-main {
    padding-top: 12px;
  }

  .public-hero-copy,
  .public-panel {
    padding: 20px;
  }

  .public-hero-panel {
    min-height: 260px;
  }

  .solar-sun {
    width: 70px;
    height: 70px;
    top: 24px;
    right: 24px;
  }

  .public-info-grid,
  .public-form,
  .public-card-grid {
    grid-template-columns: 1fr;
  }

  .public-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .public-action-card {
    grid-template-columns: 1fr;
  }

  .public-modal {
    align-items: end;
    padding: 12px;
  }

  .public-modal-card {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 22px 22px 16px 16px;
    padding: 22px;
  }

  .os-modal {
    align-items: end;
    padding: 10px;
    z-index: 10000;
  }

  .os-modal-card {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 16px 16px 10px 10px;
  }

  .os-modal-head,
  .os-modal-actions {
    align-items: stretch;
    padding: 12px;
  }

  .os-modal-head {
    flex-wrap: wrap;
  }

  .os-modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  }

  .os-modal-actions button,
  .lead-request-review-card .os-modal-actions button {
    min-height: 42px;
    width: 100%;
  }

  .lead-request-review-body {
    max-height: calc(100dvh - 160px);
    padding: 12px;
  }

  .stage-approval-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-language-control {
    justify-content: space-between;
  }

  .app-shell {
    display: block;
  }

  .sidebar-drag {
    display: none;
  }

  .sidebar-reveal,
  .detail-reveal,
  .sidebar-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-reveal.hidden,
  .detail-reveal.hidden {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 160;
    width: min(284px, 86vw);
    height: 100vh;
    min-height: auto;
    padding: 18px 14px;
    transform: translateX(0);
    box-shadow: 18px 0 42px rgba(0, 0, 0, 0.34);
    transition: transform 180ms ease, opacity 160ms ease;
  }

  .app-shell.sidebar-hidden .sidebar {
    width: min(284px, 86vw);
    padding: 18px 14px;
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
  }

  .sidebar .brand span,
  .sidebar .nav-item,
  .sidebar .sidebar-footer,
  .sidebar .sidebar-control,
  .sidebar:not(:hover):not(:focus-within) .brand span,
  .sidebar:not(:hover):not(:focus-within) .nav-item,
  .sidebar:not(:hover):not(:focus-within) .sidebar-footer,
  .sidebar:not(:hover):not(:focus-within) .sidebar-control {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .sidebar .brand,
  .sidebar .sidebar-control,
  .sidebar .sidebar-footer {
    display: none;
  }

  .brand img,
  .sidebar:hover .brand img,
  .sidebar:focus-within .brand img {
    width: 116px;
  }

  .detail-panel {
    padding: 0;
  }

  .detail-panel > .detail-content,
  .detail-panel > #projectForm,
  .detail-panel > .detail-empty {
    width: 100vw;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 18px;
  }

  .detail-head {
    top: -18px;
    margin: -18px -18px 16px;
    padding: 18px 18px 12px;
  }

  #detailContent .detail-head {
    padding-right: 18px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .ceo-kpis,
  .filters,
  .import-row,
  .validation-summary,
  .my-work-summary,
  .my-work-item,
  .finance-grid,
  .status-chart-row {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .quick-actions {
    display: grid;
  }

  .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .topbar-actions .notification-menu,
  .topbar-actions .notification-button,
  .topbar-actions .theme-toggle,
  .topbar-actions .date-button,
  .topbar-actions .app-language-control {
    width: 100%;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    padding: 16px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell.mobile-tile-mode {
    display: block;
    width: 100%;
    max-width: 100vw;
  }

  .app-shell.mobile-tile-mode .sidebar,
  .app-shell.mobile-tile-mode .sidebar-drag,
  .app-shell.mobile-tile-mode .sidebar-reveal,
  #showSidebar.sidebar-reveal {
    display: none !important;
  }

  .app-shell.mobile-tile-mode .topbar,
  .app-shell.mobile-tile-mode .main {
    width: 100%;
    max-width: 100vw;
  }

  .app-shell.mobile-tile-mode .main {
    padding: 12px;
    overflow-x: hidden;
  }

  .mobile-module-strip:not(.hidden) {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 230;
    margin: 0 0 12px;
    padding: 10px 12px;
  }

  .mobile-module-strip span {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-module-menu:not(.hidden) {
    display: grid;
  }

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

  .mobile-module-tile {
    min-height: 104px;
    padding: 14px;
  }

  .mobile-module-tile:hover {
    background: linear-gradient(135deg, var(--panel), var(--panel-elevated));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 260;
  }

  .topbar-title h1 {
    max-width: 100%;
    font-size: 18px;
  }

  .topbar-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .notification-menu {
    position: static;
  }

  .notification-panel {
    position: fixed;
    top: 112px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    max-height: min(62vh, 460px);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 10020;
  }
}

@media (max-width: 440px) {
  .mobile-module-grid {
    grid-template-columns: 1fr;
  }

  .mobile-module-tile {
    min-height: 88px;
  }

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

/* Phase 17A Work Intake foundation */
.work-intake-panel {
  display: grid;
  gap: 16px;
}

.work-intake-panel.hidden {
  display: none;
}

.work-intake-filters {
  align-items: end;
}

.work-intake-form {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px;
}

.work-intake-form label,
.work-intake-filters label {
  display: grid;
  gap: 6px;
}

.work-intake-form span,
.work-intake-filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.work-intake-form .wide-field {
  grid-column: 1 / -1;
}

.lead-conversion-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.lead-conversion-form label {
  display: grid;
  gap: 6px;
}

.lead-conversion-form span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-conversion-form .wide-field {
  grid-column: 1 / -1;
}

.work-intake-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.work-intake-status {
  color: var(--muted);
  font-size: 13px;
}

.lead-crm-dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.lead-crm-dashboard article,
.lead-crm-request-panel,
.lead-crm-source-panel {
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  min-width: 0;
}

.lead-crm-dashboard span,
.lead-crm-request-panel span,
.lead-crm-source-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.lead-crm-dashboard strong {
  display: block;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.1;
  margin-top: 4px;
}

.lead-crm-request-panel,
.lead-crm-source-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.lead-request-panel-head {
  display: contents;
}

.lead-request-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.lead-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  min-width: 0;
}

.lead-request-row div {
  min-width: 0;
}

.lead-request-row strong,
.lead-request-row span {
  overflow-wrap: anywhere;
}

.lead-request-pending {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.lead-request-disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.lead-link-warning {
  width: max-content;
  margin-top: 4px;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
}

.lead-crm-request-panel h3,
.lead-crm-source-panel h3 {
  margin: 0 0 4px;
}

.lead-source-mini-form {
  grid-column: 1 / -1;
}

.channel-wallet-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-soft);
  min-width: 0;
}

.channel-wallet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.channel-wallet-head h3,
.channel-wallet-columns h4 {
  margin: 0 0 4px;
}

.channel-wallet-head span,
.channel-wallet-note,
.channel-wallet-head small,
.channel-wallet-row small,
.channel-wallet-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.channel-wallet-head small,
.channel-wallet-row small {
  display: block;
  font-weight: 700;
}

.channel-wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.channel-wallet-grid article,
.channel-wallet-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  min-width: 0;
}

.channel-wallet-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.channel-wallet-grid strong,
.channel-wallet-row strong {
  color: var(--text);
}

.channel-wallet-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.channel-wallet-columns section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.commission-control-panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  padding: 16px;
  min-width: 0;
}

.commission-control-panel.hidden {
  display: none;
}

.commission-control-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.commission-control-summary article,
.commission-control-card {
  background: var(--panel-soft);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  min-width: 0;
}

.commission-control-summary article {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.commission-control-summary span,
.commission-control-meta strong {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.commission-control-summary strong {
  color: var(--text);
}

.commission-control-warning {
  color: var(--muted);
  font-size: 0.84rem;
  grid-column: 1 / -1;
  margin: 0;
}

.commission-control-filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(170px, 240px);
}

.commission-control-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.commission-control-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.commission-control-card-main {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.commission-control-card-main div,
.commission-control-card-main strong,
.commission-control-card-main span {
  min-width: 0;
}

.commission-control-card-main strong,
.commission-control-card-main span {
  display: block;
}

.commission-control-card-main span,
.commission-control-card p,
.commission-control-actions .muted-text {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
}

.commission-control-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.commission-control-meta span {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.commission-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.commission-control-actions .danger-action {
  border-color: var(--danger);
  color: var(--danger);
}

.work-intake-list {
  display: grid;
  gap: 10px;
}

.work-intake-item {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  padding: 14px;
}

.work-intake-item-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.work-intake-item-main strong {
  color: var(--text);
}

.work-intake-item-main small,
.work-intake-item-main p {
  color: var(--muted);
  margin: 0;
}

.work-intake-controls {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-ticket-item {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
}

.service-ticket-detail {
  background: var(--panel-soft);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
}

.service-ticket-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-ticket-grid label {
  display: grid;
  gap: 6px;
}

.service-ticket-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.service-ticket-grid .wide-field {
  grid-column: 1 / -1;
}

.service-ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.service-history,
.service-internal-notes,
.project-service-list {
  display: grid;
  gap: 8px;
}

.service-history-row,
.project-service-ticket {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.service-history-row span,
.service-history-row em,
.project-service-ticket span,
.project-service-ticket em,
.service-internal-notes p {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
}

.partner-linked-projects {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.partner-project-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.partner-project-row:hover {
  border-color: var(--accent);
}

.partner-project-row span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.commission-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.commission-summary span,
.commission-detail-strip span {
  min-width: 0;
}

.commission-summary strong {
  display: block;
  color: var(--text);
}

.commission-summary small {
  color: var(--muted);
  font-size: 0.74rem;
}

.commission-panel {
  margin-top: 14px;
  border-top: 1px solid var(--panel-line);
  padding-top: 14px;
}

.distributor-portal-panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.distributor-portal-note,
.distributor-alerts-head p {
  color: var(--muted);
  margin: 0 0 14px;
}

.distributor-summary-grid,
.distributor-profile-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.distributor-summary-grid article,
.distributor-profile-card article,
.distributor-stage-card,
.distributor-project-card,
.distributor-timeline-row {
  background: var(--panel-2);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
}

.distributor-summary-grid article,
.distributor-profile-card article {
  padding: 14px;
}

.distributor-summary-grid span,
.distributor-profile-card span,
.distributor-project-card span,
.distributor-timeline-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.distributor-summary-grid strong,
.distributor-profile-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 1.25rem;
}

.distributor-stage-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.distributor-stage-counts span {
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--panel-2);
}

.distributor-project-list,
.distributor-stage-list,
.distributor-alert-list {
  display: grid;
  gap: 10px;
}

.distributor-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.distributor-stage-card {
  padding: 12px;
  min-width: 0;
}

.distributor-stage-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.distributor-stage-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.distributor-stage-card header strong {
  color: var(--accent);
}

.distributor-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.distributor-project-card:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--panel-soft) 88%, var(--accent) 12%);
}

.distributor-project-copy {
  min-width: 0;
}

.distributor-project-card strong,
.distributor-timeline-row strong {
  display: block;
  color: var(--text);
}

.distributor-project-title {
  font-size: 0.96rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.distributor-project-card span {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.distributor-project-card .distributor-project-meta {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
}

.distributor-project-card .distributor-project-meta span {
  margin-top: 0;
}

.distributor-project-card .distributor-project-code {
  color: var(--accent);
  font-weight: 800;
}

.distributor-project-card .distributor-project-details {
  color: var(--muted);
}

.distributor-project-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.distributor-alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.distributor-status-timeline {
  display: grid;
  gap: 8px;
}

.distributor-timeline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.distributor-timeline-row.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

@media (max-width: 900px) {
  .work-intake-form,
  .work-intake-item,
  .work-intake-controls,
  .lead-crm-dashboard,
  .lead-crm-request-panel,
  .lead-crm-source-panel,
  .channel-wallet-grid,
  .channel-wallet-columns,
  .commission-control-filters,
  .commission-control-card-main,
  .partner-project-row,
  .commission-summary,
  .stage-approval-grid,
  .stage-approval-card.compact,
  .lead-request-review-grid,
  .distributor-summary-grid,
  .distributor-profile-card,
  .distributor-project-card {
    grid-template-columns: 1fr;
  }

  .work-intake-actions {
    justify-content: stretch;
  }

  .distributor-alerts-head {
    align-items: stretch;
    flex-direction: column;
  }

  .commission-control-card-main {
    align-items: stretch;
    flex-direction: column;
  }

  .distributor-project-actions {
    justify-content: flex-start;
  }

  .mobile-module-tile strong,
  .mobile-module-tile span {
    overflow-wrap: anywhere;
  }

  .mobile-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }
}

/* Phase 33 final cascade: keep the public entry page in cyber/HUD mode. */
body .public-landing {
  overflow-x: hidden;
  background:
    linear-gradient(rgba(23, 238, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 238, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 28%, rgba(11, 211, 255, 0.22), transparent 28%),
    radial-gradient(circle at 14% 72%, rgba(244, 182, 59, 0.11), transparent 24%),
    linear-gradient(145deg, #020712 0%, #061122 42%, #02040a 100%);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

body .cyber-public-main {
  padding-top: 24px;
}

body .public-hero.cyber-hero-shell {
  grid-template-columns: minmax(220px, 0.82fr) minmax(420px, 1.18fr) minmax(220px, 0.82fr);
  align-items: center;
  gap: 18px;
}

body .cyber-action-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

body .public-action-card.cyber-action-card {
  min-height: 142px;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(23, 238, 255, 0.34);
  border-radius: 8px;
  padding: 18px;
  color: #edfaff;
  background:
    linear-gradient(135deg, rgba(5, 17, 31, 0.94), rgba(6, 30, 45, 0.86)),
    radial-gradient(circle at 100% 0%, rgba(23, 238, 255, 0.16), transparent 36%);
  box-shadow: 0 0 0 1px rgba(23, 238, 255, 0.07), 0 18px 48px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

body .public-action-card.cyber-action-card strong {
  color: #f8fdff;
  font-size: 17px;
  line-height: 1.2;
}

body .public-action-card.cyber-action-card small {
  max-width: 28ch;
  color: #a9c0d0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body .public-action-card.cyber-action-card em {
  color: #17eeff;
}

body .public-hero-copy.cyber-orb-zone {
  min-height: 640px;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  border: 1px solid rgba(23, 238, 255, 0.3);
  border-radius: 8px;
  padding: 32px;
  background:
    radial-gradient(circle at 50% 48%, rgba(23, 238, 255, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(7, 22, 38, 0.82), rgba(2, 8, 18, 0.92));
  box-shadow: inset 0 0 58px rgba(23, 238, 255, 0.08), 0 28px 70px rgba(0, 0, 0, 0.42);
}

body .public-hero-copy.cyber-orb-zone h1 {
  max-width: 780px;
  margin: 16px auto 14px;
  color: #fbfeff;
  font-size: 42px;
  line-height: 1.08;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(23, 238, 255, 0.18);
}

body .cyber-bottom-hud {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  body .public-hero.cyber-hero-shell {
    grid-template-columns: 1fr;
  }

  body .public-hero-copy.cyber-orb-zone {
    order: -1;
    min-height: 0;
  }

  body .cyber-action-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Phase 34: compact project detail tiles */
#detailContent .detail-section {
  margin-top: 12px;
  padding-top: 12px;
}

#detailContent .detail-section h3 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.2;
}

#detailContent .detail-mini-section {
  border-top-color: rgba(148, 168, 188, 0.22);
}

#detailContent .detail-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: stretch;
}

#detailContent .detail-action-grid {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
}

#detailContent .detail-action-tile {
  width: auto;
  min-height: 54px;
  display: grid;
  gap: 3px;
  align-content: center;
  justify-items: start;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
}

#detailContent .detail-action-tile strong {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.2;
}

#detailContent .detail-action-tile span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

#detailContent .detail-linked-list {
  min-width: 0;
  align-content: start;
}

#detailContent .detail-linked-list .empty-state {
  min-height: 54px;
  display: grid;
  align-content: center;
  border: 1px dashed rgba(148, 168, 188, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.025);
}

#detailContent .project-service-ticket.detail-compact-tile {
  padding: 8px 10px;
  gap: 3px;
}

#detailContent .project-service-ticket.detail-compact-tile strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

#detailContent .project-service-ticket.detail-compact-tile span,
#detailContent .project-service-ticket.detail-compact-tile em {
  font-size: 0.76rem;
  line-height: 1.25;
}

#detailContent .detail-assignment-section .stage-editor {
  grid-template-columns: 1fr;
  gap: 6px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
}

#detailContent .detail-assignment-section .stage-editor strong {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

#stageCompletionRequestSection .work-completion-summary {
  gap: 6px;
}

#stageCompletionRequestSection .workflow-reason {
  margin-top: 9px;
}

#stageCompletionRequestSection textarea {
  min-height: 58px;
}

#stageCompletionRequestSection .workflow-save-button {
  width: auto;
  min-height: 38px;
  justify-self: start;
  padding: 8px 12px;
}

#stageCompletionRequestSection .work-completion-status {
  margin-top: 7px;
}

#detailContent .workflow-history {
  gap: 6px;
}

#detailContent .workflow-history-item {
  padding: 8px 9px;
  gap: 3px;
}

#detailContent .workflow-history-item strong,
#detailContent .workflow-history-item span {
  font-size: 0.76rem;
}

#detailContent .workflow-history-item em,
#detailContent .workflow-history-item small,
#detailContent .workflow-history-empty {
  font-size: 0.7rem;
}

#detailContent .workflow-history-empty {
  padding: 9px 10px;
}

#detailContent .project-summary-section .detail-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

#detailContent .project-summary-section .detail-facts label {
  padding: 9px 10px;
}

#detailContent .project-summary-section .detail-facts label:nth-child(2n),
#detailContent .project-summary-section .detail-facts label:last-child,
#detailContent .project-summary-section .detail-facts label:nth-last-child(-n + 2) {
  border-right: 1px solid var(--panel-line);
  border-bottom: 1px solid var(--panel-line);
}

#detailContent .project-summary-section .detail-facts label:nth-child(3n),
#detailContent .project-summary-section .detail-facts label:last-child {
  border-right: 0;
}

#detailContent .project-summary-section .detail-facts label:nth-last-child(-n + 3) {
  border-bottom: 0;
}

#detailContent .project-summary-section .detail-summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#detailContent .project-summary-section .detail-summary-strip span {
  padding: 8px 9px;
}

@media (max-width: 900px) {
  #detailContent .detail-action-grid,
  #detailContent .project-summary-section .detail-facts,
  #detailContent .project-summary-section .detail-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #detailContent .project-summary-section .detail-facts label:nth-child(n) {
    border-right: 1px solid var(--panel-line);
    border-bottom: 1px solid var(--panel-line);
  }

  #detailContent .project-summary-section .detail-facts label:nth-child(2n),
  #detailContent .project-summary-section .detail-facts label:last-child {
    border-right: 0;
  }

  #detailContent .project-summary-section .detail-facts label:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  #detailContent .detail-compact-grid,
  #detailContent .detail-action-grid,
  #detailContent .project-summary-section .detail-facts,
  #detailContent .project-summary-section .detail-summary-strip {
    grid-template-columns: 1fr;
  }

  #detailContent .project-summary-section .detail-facts label:nth-child(n) {
    border-right: 0;
    border-bottom: 1px solid var(--panel-line);
  }

  #detailContent .project-summary-section .detail-facts label:last-child {
    border-bottom: 0;
  }
}

/* Phase 35: strategic Project Detail control panel layout */
#detailContent .project-control-section {
  border-top-color: rgba(148, 168, 188, 0.2);
}

#detailContent .project-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: stretch;
}

#detailContent .project-lifecycle-row,
#detailContent .project-workflow-row {
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

#detailContent .project-completion-row {
  grid-template-columns: minmax(170px, 0.8fr) minmax(190px, 1fr) minmax(220px, 1.25fr) minmax(170px, 0.85fr);
}

#detailContent .project-control-tile,
#detailContent .project-compact-note,
#detailContent .project-action-tile {
  min-width: 0;
  min-height: 70px;
  margin: 0;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  padding: 10px;
}

#detailContent .project-control-tile.hidden,
#detailContent .project-compact-note.hidden,
#detailContent .project-action-tile.hidden {
  display: none !important;
}

#detailContent .project-control-tile {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-content: start;
}

#detailContent .project-control-tile strong,
#detailContent .project-compact-note span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: uppercase;
}

#detailContent .project-control-tile select,
#detailContent .project-control-tile input {
  min-height: 34px;
}

#detailContent .project-compact-note {
  display: grid;
  gap: 6px;
}

#detailContent .project-compact-note textarea {
  min-height: 44px;
  resize: vertical;
}

#detailContent .project-action-tile {
  width: auto;
  min-height: 70px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
}

#detailContent button.project-action-tile {
  font-size: 0.8rem;
  line-height: 1.2;
}

#detailContent .project-lifecycle-row .project-action-tile,
#detailContent .project-workflow-row .project-action-tile,
#detailContent .project-completion-row .project-action-tile {
  margin-top: 0;
}

#detailContent #projectLifecycleMeta {
  margin-top: 8px;
}

#detailContent #projectLifecycleSection .project-compact-note {
  min-height: 58px;
  margin-top: 10px;
}

#detailContent #workflowUpdateSection .project-compact-note {
  min-height: 70px;
}

#detailContent #stageCompletionRequestSection .work-completion-summary.project-control-tile {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  gap: 6px;
}

#detailContent #stageCompletionRequestSection .work-completion-status.project-control-tile {
  display: grid;
  align-content: center;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.35;
}

#detailContent #stageCompletionRequestSection .status-pill {
  min-height: 26px;
  padding: 5px 8px;
  font-size: 0.68rem;
}

#detailContent .detail-history-section {
  opacity: 0.96;
}

#detailContent .detail-history-section h3 {
  color: var(--muted);
}

@media (max-width: 980px) {
  #detailContent .project-completion-row,
  #detailContent .project-lifecycle-row,
  #detailContent .project-workflow-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #detailContent .project-control-grid,
  #detailContent .project-completion-row,
  #detailContent .project-lifecycle-row,
  #detailContent .project-workflow-row {
    grid-template-columns: 1fr;
  }

  #detailContent .project-action-tile {
    width: 100%;
  }
}

/* Phase 36: compact collapsed Document Checklist in Project Detail */
#detailContent .document-control-section {
  border-top-color: rgba(148, 168, 188, 0.2);
}

#detailContent .document-control-section .document-v2-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

#detailContent .document-checklist {
  gap: 0;
}

#detailContent .document-checklist-shell {
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: #0a1826;
  overflow: hidden;
}

#detailContent .document-checklist-summary {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(0, 1.5fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

#detailContent .document-checklist-summary::-webkit-details-marker {
  display: none;
}

#detailContent .document-summary-count {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.25;
}

#detailContent .document-summary-chips {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#detailContent .document-chip {
  max-width: 154px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 168, 188, 0.28);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#detailContent .document-chip.checked {
  border-color: rgba(25, 195, 125, 0.42);
  color: #8ef4c2;
  background: rgba(25, 195, 125, 0.12);
}

#detailContent .document-chip.more {
  border-style: dashed;
  color: var(--muted);
}

#detailContent .document-summary-toggle {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 96px;
  color: #7ab5ff;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: right;
}

#detailContent .document-summary-toggle em {
  font-style: normal;
}

#detailContent .document-checklist-shell .hide-label,
#detailContent .document-checklist-shell[open] .view-label {
  display: none;
}

#detailContent .document-checklist-shell[open] .hide-label {
  display: inline;
}

#detailContent .document-checklist-expanded {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

#detailContent .document-checklist-expanded .document-check {
  min-height: 34px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 8px;
}

#detailContent .document-checklist-expanded .document-check span {
  font-size: 0.76rem;
  line-height: 1.2;
}

#detailContent .document-checklist-expanded .document-check em {
  grid-column: 2;
  font-size: 0.64rem;
  line-height: 1.15;
}

#detailContent .document-control-section #documentReasonRow {
  min-height: 58px;
  margin-top: 9px;
}

#detailContent .document-control-section #documentChangeReason {
  min-height: 44px;
}

#detailContent .document-control-section #saveDocumentUpdate {
  width: auto;
  min-height: 42px;
  margin-top: 9px;
  justify-self: start;
}

@media (max-width: 900px) {
  #detailContent .document-checklist-summary {
    grid-template-columns: 1fr;
  }

  #detailContent .document-summary-toggle {
    justify-content: flex-start;
    text-align: left;
  }

  #detailContent .document-checklist-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #detailContent .document-checklist-expanded {
    grid-template-columns: 1fr;
  }

  #detailContent .document-chip {
    max-width: 100%;
  }
}

/* Phase 37: Project Detail tile-navigation control panel */
#detailContent .project-section-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 9px;
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid rgba(148, 168, 188, 0.22);
  border-radius: 8px;
  background: rgba(10, 24, 38, 0.72);
}

#detailContent .project-section-tile-grid.hidden,
#detailContent .project-active-section-panel.hidden {
  display: none !important;
}

#detailContent .project-section-tile {
  min-width: 0;
  min-height: 48px;
  display: grid;
  align-content: center;
  justify-items: start;
  border: 1px solid rgba(148, 168, 188, 0.24);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text-secondary);
  background: #071420;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

#detailContent .project-section-tile:hover,
#detailContent .project-section-tile:focus-visible {
  border-color: rgba(122, 181, 255, 0.58);
  color: var(--text);
  background: rgba(14, 165, 233, 0.12);
}

#detailContent .project-section-tile.active {
  border-color: rgba(31, 160, 151, 0.7);
  color: #dffcff;
  background: linear-gradient(135deg, rgba(31, 160, 151, 0.2), rgba(14, 165, 233, 0.12));
  box-shadow: inset 0 0 0 1px rgba(31, 160, 151, 0.16), 0 10px 24px rgba(0, 0, 0, 0.16);
}

#detailContent .project-active-section-panel {
  margin-top: 10px;
  border: 1px solid rgba(148, 168, 188, 0.2);
  border-radius: 8px;
  background: rgba(7, 20, 32, 0.46);
  padding: 10px;
}

#detailContent .project-active-section-panel > .detail-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#detailContent .project-section-panel.project-section-inactive {
  display: none !important;
}

#detailContent .project-section-panel.project-section-active {
  display: block;
}

#detailContent #projectSourceSection .project-source-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

#detailContent #projectSourceSection .project-compact-note {
  margin-top: 10px;
}

#detailContent #projectSourceSection #saveProjectSource {
  width: auto;
  min-height: 42px;
  margin-top: 9px;
  justify-self: start;
}

#detailContent #completionRequestsSection .completion-request-list {
  gap: 6px;
}

#detailContent #completionRequestsSection .completion-request-item {
  padding: 8px 9px;
}

#detailContent #completionRequestsSection .completion-request-item strong,
#detailContent #completionRequestsSection .completion-request-item span,
#detailContent #completionRequestsSection .completion-request-item em,
#detailContent #completionRequestsSection .completion-request-item small {
  font-size: 0.74rem;
}

@media (max-width: 900px) {
  #detailContent .project-section-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #detailContent .project-section-tile-grid {
    grid-template-columns: 1fr;
  }

  #detailContent .project-active-section-panel {
    padding: 8px;
  }
}

/* Keep live Phase 43 controls authoritative over the earlier preview defaults. */
#adminAccessPreviewPanel .admin-access-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#adminAccessPreviewPanel .admin-mock-form input,
#adminAccessPreviewPanel .admin-mock-form select {
  color: var(--ui-text);
  background: var(--ui-surface);
  cursor: text;
}

#adminAccessPreviewPanel .admin-mock-form select {
  cursor: pointer;
}

#adminAccessPreviewPanel .admin-mock-form button {
  opacity: 1;
  cursor: pointer;
}

#adminAccessPreviewPanel .admin-mock-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#adminAccessPreviewPanel .admin-user-enrollment-form {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}

#adminAccessPreviewPanel .admin-role-matrix-card {
  grid-column: 1 / -1;
}

@media (max-width: 1280px) {
  #adminAccessPreviewPanel .admin-access-summary,
  #adminAccessPreviewPanel .admin-user-enrollment-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #adminAccessPreviewPanel .admin-access-summary,
  #adminAccessPreviewPanel .admin-user-enrollment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #adminAccessPreviewPanel .admin-access-summary,
  #adminAccessPreviewPanel .admin-user-enrollment-form {
    grid-template-columns: 1fr;
  }
}

/* Phase 38: light blue Project Detail section tiles */
#detailContent .project-section-tile-grid {
  border-color: rgba(125, 211, 252, 0.34);
  background:
    linear-gradient(180deg, rgba(8, 47, 73, 0.52), rgba(7, 20, 32, 0.76)),
    radial-gradient(circle at 16% 0%, rgba(56, 189, 248, 0.16), transparent 42%);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.08);
}

#detailContent .project-section-tile {
  position: relative;
  border-color: rgba(125, 211, 252, 0.46);
  color: #e5f8ff;
  background:
    linear-gradient(145deg, rgba(14, 116, 144, 0.52), rgba(8, 47, 73, 0.78)),
    radial-gradient(circle at 100% 0%, rgba(125, 211, 252, 0.22), transparent 42%);
  box-shadow: 0 8px 22px rgba(2, 8, 20, 0.2), inset 0 0 0 1px rgba(186, 230, 253, 0.05);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

#detailContent .project-section-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, rgba(186, 230, 253, 0.72), rgba(34, 211, 238, 0.28));
  opacity: 0.62;
}

#detailContent .project-section-tile:hover,
#detailContent .project-section-tile:focus-visible {
  border-color: rgba(186, 230, 253, 0.86);
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(14, 165, 233, 0.58), rgba(8, 78, 116, 0.86)),
    radial-gradient(circle at 100% 0%, rgba(186, 230, 253, 0.28), transparent 44%);
  box-shadow: 0 0 0 1px rgba(186, 230, 253, 0.16), 0 12px 28px rgba(14, 165, 233, 0.18);
  transform: translateY(-1px);
}

#detailContent .project-section-tile.active {
  border-color: rgba(224, 242, 254, 0.96);
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(2, 132, 199, 0.78), rgba(8, 145, 178, 0.64)),
    radial-gradient(circle at 88% 10%, rgba(224, 242, 254, 0.34), transparent 48%);
  box-shadow: 0 0 0 1px rgba(224, 242, 254, 0.22), 0 14px 34px rgba(14, 165, 233, 0.26);
}

#detailContent .project-section-tile.active::before {
  width: 4px;
  background: linear-gradient(180deg, #e0f2fe, #22d3ee);
  opacity: 1;
}

@media (max-width: 760px) {
  body .cyber-public-main {
    padding-top: 12px;
  }

  body .public-hero-copy.cyber-orb-zone {
    padding: 22px 16px;
  }

  body .public-hero-copy.cyber-orb-zone h1 {
    font-size: 29px;
  }

  body .cyber-action-column,
  body .cyber-hud-row,
  body .cyber-bottom-hud {
    grid-template-columns: 1fr;
  }

  body .public-action-card.cyber-action-card {
    min-height: 0;
  }
}


/* Phase 41F: professional public landing page preview */
body .public-landing.landing-v2 {
  --landing-cyan: #19d9ff;
  --landing-cyan-soft: rgba(25, 217, 255, 0.22);
  --landing-cyan-line: rgba(25, 217, 255, 0.42);
  --landing-ink: #030a14;
  --landing-panel: rgba(4, 19, 34, 0.9);
  --landing-panel-soft: rgba(5, 25, 43, 0.82);
  min-height: 100vh;
  color: #edf9ff;
  background:
    linear-gradient(rgba(25, 217, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 217, 255, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 50% 38%, rgba(0, 184, 255, 0.17), transparent 32%),
    linear-gradient(160deg, #020812 0%, #061322 46%, #02070f 100%);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

body .public-landing.landing-v2::before {
  inset: 16px;
  border: 1px solid rgba(25, 217, 255, 0.16);
  border-radius: 4px;
  box-shadow:
    inset 0 0 54px rgba(25, 217, 255, 0.05),
    0 0 70px rgba(0, 0, 0, 0.34);
}

body .public-landing.landing-v2::after {
  width: 520px;
  height: 520px;
  right: -220px;
  top: 12%;
  background: radial-gradient(circle, rgba(25, 217, 255, 0.12), transparent 70%);
}

body .landing-nav,
body .landing-main,
body .landing-footer {
  width: min(1560px, calc(100% - 56px));
}

body .landing-nav {
  min-height: 86px;
  padding: 14px 18px;
  border: 1px solid rgba(25, 217, 255, 0.16);
  border-top: 0;
  background: rgba(2, 10, 20, 0.76);
  backdrop-filter: blur(18px);
}

body .landing-brand {
  color: inherit;
  text-decoration: none;
}

body .landing-brand img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  padding: 4px;
}

body .landing-brand strong {
  font-size: 21px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body .landing-brand span {
  color: #90aabd;
  letter-spacing: 0.04em;
}

body .landing-header-actions {
  align-items: center;
}

body .landing-login-button {
  min-width: 124px;
  border-color: rgba(25, 217, 255, 0.72);
  color: #67eaff;
  background: rgba(6, 31, 49, 0.62);
  box-shadow: inset 0 0 18px rgba(25, 217, 255, 0.08);
}

body .landing-main {
  padding: 18px 0 26px;
}

body .landing-hero-shell {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2vw, 30px);
  border: 1px solid rgba(25, 217, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(3, 12, 23, 0.94), rgba(4, 20, 35, 0.84)),
    radial-gradient(circle at 50% 52%, rgba(25, 217, 255, 0.08), transparent 42%);
  box-shadow: inset 0 0 70px rgba(25, 217, 255, 0.035), 0 28px 80px rgba(0, 0, 0, 0.38);
}

body .landing-hero-shell::before,
body .landing-hero-shell::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 34px;
  pointer-events: none;
}

body .landing-hero-shell::before {
  top: -1px;
  left: -1px;
  border-top: 3px solid var(--landing-cyan);
  border-left: 3px solid var(--landing-cyan);
}

body .landing-hero-shell::after {
  right: -1px;
  bottom: -1px;
  border-right: 3px solid var(--landing-cyan);
  border-bottom: 3px solid var(--landing-cyan);
}

body .landing-status-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 9px 14px;
  color: #7fdff0;
  border-bottom: 1px solid rgba(25, 217, 255, 0.16);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body .landing-status-strip span:first-child {
  color: #a9f5ff;
}

body .landing-status-strip i,
body .landing-core-status span {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: #2ce6a6;
  box-shadow: 0 0 12px rgba(44, 230, 166, 0.82);
}

body .landing-headline {
  max-width: 1020px;
  margin: 22px auto 18px;
  text-align: center;
}

body .landing-headline .landing-eyebrow {
  margin: 0 0 9px;
  color: #63dff5;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

body .landing-headline h1 {
  margin: 0;
  color: #f5fbff;
  font-size: clamp(34px, 4.2vw, 64px);
  line-height: 1.02;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow: 0 0 24px rgba(25, 217, 255, 0.17);
}

body .landing-headline > p:last-child {
  max-width: 790px;
  margin: 14px auto 0;
  color: #b8cddd;
  font-size: 17px;
  line-height: 1.6;
  text-wrap: balance;
}

body .landing-command-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(430px, 1fr) minmax(280px, 360px);
  gap: clamp(16px, 2vw, 30px);
  align-items: center;
  margin-top: 10px;
}

body .landing-action-column {
  display: grid;
  gap: 16px;
}

body .public-action-card.landing-action-card {
  position: relative;
  min-height: 164px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--landing-cyan-line);
  border-radius: 0;
  color: #eefaff;
  background:
    linear-gradient(135deg, rgba(4, 18, 32, 0.96), rgba(5, 31, 48, 0.84)),
    radial-gradient(circle at 100% 0%, rgba(25, 217, 255, 0.12), transparent 42%);
  box-shadow: inset 0 0 28px rgba(25, 217, 255, 0.035), 0 18px 42px rgba(0, 0, 0, 0.28);
  clip-path: polygon(18px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 16px 100%, 0 calc(100% - 16px), 0 18px);
}

body .public-action-card.landing-action-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-top: 1px solid rgba(25, 217, 255, 0.12);
  border-bottom: 1px solid rgba(25, 217, 255, 0.08);
  pointer-events: none;
}

body .public-action-card.landing-action-card:hover,
body .public-action-card.landing-action-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(25, 217, 255, 0.92);
  background:
    linear-gradient(135deg, rgba(5, 28, 45, 0.98), rgba(4, 38, 57, 0.9)),
    radial-gradient(circle at 100% 0%, rgba(25, 217, 255, 0.2), transparent 42%);
  box-shadow: 0 0 26px rgba(25, 217, 255, 0.16), 0 22px 52px rgba(0, 0, 0, 0.34);
}

body .landing-action-card-alert {
  border-color: rgba(255, 105, 105, 0.52) !important;
}

body .landing-action-card-alert .landing-card-copy > small,
body .landing-action-card-alert .landing-card-copy em {
  color: #ff8585;
}

body .landing-card-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: #58e9ff;
  border: 1px solid rgba(25, 217, 255, 0.5);
  background: rgba(4, 23, 38, 0.74);
  clip-path: polygon(50% 0, 92% 24%, 92% 76%, 50% 100%, 8% 76%, 8% 24%);
  box-shadow: inset 0 0 20px rgba(25, 217, 255, 0.08);
}

body .landing-card-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body .landing-card-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

body .landing-card-copy > small {
  color: #55dff6;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

body .landing-card-copy strong {
  color: #f6fcff;
  font-size: 19px;
  line-height: 1.2;
}

body .landing-card-copy > span {
  color: #aec5d5;
  font-size: 13px;
  line-height: 1.45;
}

body .landing-card-copy em {
  color: #4de7ff;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.04em;
}

body .landing-core-shell {
  min-height: 590px;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 24px;
  border-left: 1px solid rgba(25, 217, 255, 0.12);
  border-right: 1px solid rgba(25, 217, 255, 0.12);
  background:
    radial-gradient(circle at 50% 50%, rgba(25, 217, 255, 0.14), transparent 48%),
    linear-gradient(180deg, rgba(3, 13, 24, 0.34), rgba(4, 20, 34, 0.12));
}

body .landing-core-status {
  color: #8beaf8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body .cyber-orb.landing-orb {
  width: min(430px, 76vw);
  margin: 24px auto 20px;
  background:
    radial-gradient(circle, rgba(245, 254, 255, 0.96) 0 7%, rgba(25, 217, 255, 0.4) 8% 17%, transparent 18%),
    repeating-radial-gradient(circle, transparent 0 18px, rgba(25, 217, 255, 0.09) 19px 20px),
    radial-gradient(circle, rgba(25, 217, 255, 0.18), transparent 64%);
  box-shadow:
    0 0 38px rgba(25, 217, 255, 0.34),
    inset 0 0 60px rgba(25, 217, 255, 0.18);
}

body .landing-orb .cyber-orb-ring-one {
  border: 2px solid rgba(25, 217, 255, 0.78);
  box-shadow: 0 0 26px rgba(25, 217, 255, 0.3), inset 0 0 20px rgba(25, 217, 255, 0.08);
}

body .landing-orb .cyber-orb-ring-two {
  inset: 42px;
  border: 2px dashed rgba(25, 217, 255, 0.58);
}

body .landing-orb-core {
  width: 190px;
  height: 190px;
  border: 2px solid rgba(25, 217, 255, 0.68);
  background:
    radial-gradient(circle at 50% 30%, rgba(25, 217, 255, 0.12), transparent 54%),
    linear-gradient(180deg, rgba(5, 22, 38, 0.98), rgba(2, 10, 20, 0.98));
  box-shadow: inset 0 0 34px rgba(25, 217, 255, 0.1), 0 0 26px rgba(25, 217, 255, 0.16);
}

body .landing-orb-core strong {
  color: #9cf2ff;
  font-size: 28px;
  letter-spacing: 0.08em;
}

body .landing-orb-core span {
  font-size: 66px;
  text-shadow: 0 0 22px rgba(25, 217, 255, 0.5);
}

body .landing-orb-core small {
  color: #9fefff;
  letter-spacing: 0.05em;
}

body .landing-orb-tick {
  position: absolute;
  z-index: 2;
  width: 14px;
  height: 14px;
  border: 2px solid #7af0ff;
  background: #061a2a;
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(25, 217, 255, 0.5);
}

body .landing-orb-tick.tick-one { top: -6px; left: calc(50% - 7px); }
body .landing-orb-tick.tick-two { right: -6px; top: calc(50% - 7px); }
body .landing-orb-tick.tick-three { bottom: -6px; left: calc(50% - 7px); }
body .landing-orb-tick.tick-four { left: -6px; top: calc(50% - 7px); }

body .landing-core-caption {
  margin: 0;
  color: #89a7ba;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

body .landing-contact-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
  border: 1px solid rgba(25, 217, 255, 0.24);
  background: rgba(3, 16, 29, 0.78);
}

body .landing-contact-bar a {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  color: #edfaff;
  text-decoration: none;
  border-right: 1px solid rgba(25, 217, 255, 0.16);
}

body .landing-contact-bar a:last-child {
  border-right: 0;
}

body .landing-contact-bar a:hover,
body .landing-contact-bar a:focus-visible {
  background: rgba(25, 217, 255, 0.08);
}

body .landing-contact-bar span {
  color: #59def4;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

body .landing-contact-bar strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

body .landing-footer {
  min-height: 58px;
  padding: 13px 8px 22px;
  border-top: 1px solid rgba(25, 217, 255, 0.13);
}

body .landing-footer a {
  color: #6ee8fb;
  text-decoration: none;
}

body .public-panel-card-professional {
  gap: 16px;
}

body .public-info-grid-clean {
  margin-top: 4px;
}

body .public-cta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

body .public-contact-action {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 15px;
  color: #effaff;
  text-decoration: none;
  border: 1px solid rgba(25, 217, 255, 0.26);
  border-radius: 8px;
  background: rgba(4, 22, 36, 0.76);
}

body .public-contact-action:hover,
body .public-contact-action:focus-visible {
  border-color: rgba(25, 217, 255, 0.7);
  background: rgba(25, 217, 255, 0.08);
}

body .public-contact-action span {
  color: #63dff5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body .public-contact-action strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

@media (max-width: 1220px) {
  body .landing-command-grid {
    grid-template-columns: 1fr;
  }

  body .landing-core-shell {
    order: -1;
    min-height: 500px;
    border: 1px solid rgba(25, 217, 255, 0.12);
  }

  body .landing-action-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body .public-action-card.landing-action-card {
    min-height: 176px;
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 16px;
  }

  body .landing-card-icon {
    width: 56px;
    height: 56px;
  }

  body .landing-card-icon svg {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 820px) {
  body .landing-nav,
  body .landing-main,
  body .landing-footer {
    width: min(100% - 24px, 1560px);
  }

  body .landing-nav {
    padding: 12px;
  }

  body .landing-brand strong {
    font-size: 17px;
  }

  body .landing-brand span {
    display: none;
  }

  body .landing-headline h1 {
    font-size: clamp(30px, 9vw, 44px);
  }

  body .landing-headline > p:last-child {
    font-size: 15px;
  }

  body .landing-action-column,
  body .landing-contact-bar,
  body .public-cta-grid {
    grid-template-columns: 1fr;
  }

  body .landing-contact-bar a {
    border-right: 0;
    border-bottom: 1px solid rgba(25, 217, 255, 0.14);
  }

  body .landing-contact-bar a:last-child {
    border-bottom: 0;
  }

  body .public-action-card.landing-action-card {
    min-height: 0;
  }

  body .cyber-orb.landing-orb {
    width: min(340px, 78vw);
  }

  body .landing-orb-core {
    width: 150px;
    height: 150px;
  }

  body .landing-orb-core span {
    font-size: 52px;
  }

  body .landing-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  body .landing-footer .public-footer-items {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  body .landing-header-actions {
    gap: 8px;
  }

  body .landing-header-actions .public-language span {
    display: none;
  }

  body .landing-login-button {
    min-width: 92px;
  }

  body .landing-hero-shell {
    padding: 14px;
  }

  body .landing-status-strip {
    justify-content: flex-start;
  }

  body .landing-status-strip span:not(:first-child) {
    display: none;
  }

  body .public-action-card.landing-action-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  body .landing-card-icon {
    width: 52px;
    height: 52px;
  }
}


/* ==========================================================================
   Phase 41G — Compact Project Detail control panel
   Focused visual patch. Internal engines and data behavior are preserved.
   ========================================================================== */

#detailContent {
  --project-cyan: #28d9f7;
  --project-blue: #075d9b;
  --project-blue-strong: #087fca;
  --project-black: #02070f;
  --project-card: #071725;
  --project-line: rgba(40, 217, 247, 0.24);
}

.detail-panel > #detailContent {
  width: min(95vw, 1380px);
  max-height: 94vh;
  padding: 16px;
  border-color: rgba(40, 217, 247, 0.34);
  border-radius: 6px;
  background:
    linear-gradient(rgba(40, 217, 247, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 217, 247, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 82% 8%, rgba(40, 217, 247, 0.08), transparent 32%),
    #04111d;
  background-size: 34px 34px, 34px 34px, auto, auto;
  box-shadow: inset 0 0 46px rgba(40, 217, 247, 0.035), 0 30px 84px rgba(0, 0, 0, 0.58);
}

#detailContent .detail-head {
  top: -16px;
  margin: -16px -16px 10px;
  min-height: 60px;
  align-items: center;
  padding: 10px 14px;
  border-bottom-color: rgba(40, 217, 247, 0.22);
  background: rgba(3, 14, 24, 0.96);
  backdrop-filter: blur(14px);
}

#detailContent .detail-head > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

#detailContent .detail-head .eyebrow {
  margin: 0;
  padding: 5px 8px;
  border: 1px solid rgba(40, 217, 247, 0.28);
  border-radius: 4px;
  color: #64e8ff;
  background: rgba(7, 93, 155, 0.22);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

#detailContent .detail-title-input {
  min-width: 0;
  min-height: 34px;
  font-size: 1.05rem;
}

#detailContent #closeDetail {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid rgba(40, 217, 247, 0.42);
  border-radius: 5px;
  color: #ecfbff;
  background: var(--project-black);
}

#detailContent .project-summary-section {
  margin-top: 0;
  padding: 10px;
  border: 1px solid rgba(40, 217, 247, 0.18);
  border-radius: 5px;
  background: rgba(5, 21, 35, 0.86);
}

#detailContent .project-summary-section > h3 {
  margin-bottom: 7px;
  color: #6feaff;
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#detailContent .project-summary-section .detail-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 8px;
  border-color: rgba(40, 217, 247, 0.18);
  border-radius: 4px;
}

#detailContent .project-summary-section .detail-facts label:nth-child(n) {
  min-width: 0;
  min-height: 54px;
  padding: 7px 9px;
  border-right: 1px solid rgba(40, 217, 247, 0.14);
  border-bottom: 1px solid rgba(40, 217, 247, 0.14);
  background: rgba(6, 24, 39, 0.74);
}

#detailContent .project-summary-section .detail-facts label:nth-child(4n) {
  border-right: 0;
}

#detailContent .project-summary-section .detail-facts label:nth-last-child(-n + 2) {
  border-bottom: 0;
}

#detailContent .project-summary-section .detail-facts span,
#detailContent .detail-summary-strip strong,
#detailContent .priority-editor span {
  color: #7fc9d8;
  font-size: 0.62rem;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

#detailContent .project-summary-section .detail-facts input {
  min-width: 0;
  min-height: 24px;
  color: #f4fbff;
  font-size: 0.78rem;
}

#detailContent .core-edit-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin: 0 0 8px;
  padding: 7px 9px;
  border-radius: 4px;
}

#detailContent .core-edit-actions .workflow-save-button {
  width: auto;
  min-height: 32px;
  margin: 0;
  padding: 6px 11px;
}

#detailContent .project-summary-section .detail-summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

#detailContent .project-summary-section .detail-summary-strip span {
  min-height: 46px;
  padding: 6px 8px;
  border-color: rgba(40, 217, 247, 0.18);
  border-radius: 4px;
  background: rgba(3, 16, 28, 0.82);
}

#detailContent .detail-summary-strip em {
  overflow: hidden;
  color: #f2fbff;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#detailContent .priority-editor {
  grid-template-columns: 110px minmax(220px, 1fr) auto;
  gap: 7px;
  margin-top: 8px;
}

#detailContent .priority-editor label {
  gap: 4px;
}

#detailContent .priority-editor select,
#detailContent .priority-editor input {
  min-height: 34px;
}

#detailContent .priority-editor .workflow-save-button {
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 6px 11px;
}

#detailContent .priority-meta {
  font-size: 0.67rem;
}

#detailContent .project-detail-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 224px;
  grid-template-areas: "main actions";
  gap: 12px;
  align-items: start;
  margin-top: 10px;
}

#detailContent .project-detail-main-column {
  min-width: 0;
  grid-area: main;
}

#detailContent .project-section-tile-grid.project-action-rail {
  position: sticky;
  top: 58px;
  grid-area: actions;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(40, 217, 247, 0.22);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(6, 35, 56, 0.88), rgba(3, 15, 27, 0.96));
}

#detailContent .project-section-tile-grid.project-action-rail::before {
  content: "PROJECT ACTIONS";
  padding: 4px 5px 7px;
  color: #6de9ff;
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.11em;
}

#detailContent .project-section-tile {
  min-height: 40px;
  display: grid;
  gap: 1px;
  align-content: center;
  padding: 6px 9px;
  border: 1px solid rgba(86, 205, 255, 0.48);
  border-radius: 4px;
  color: #f2fbff;
  background: linear-gradient(145deg, rgba(8, 127, 202, 0.88), rgba(7, 93, 155, 0.92));
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transform: none;
}

#detailContent .project-section-tile::before {
  display: none;
}

#detailContent .project-section-tile span {
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
}

#detailContent .project-section-tile small {
  color: rgba(229, 247, 255, 0.72);
  font-size: 0.58rem;
  font-weight: 750;
  line-height: 1.15;
}

#detailContent .project-section-tile:hover,
#detailContent .project-section-tile:focus-visible {
  border-color: #7feaff;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(10, 146, 225, 0.98), rgba(7, 104, 171, 0.98));
  transform: none;
}

#detailContent .project-section-tile.active {
  border-color: #39dffb;
  color: #ffffff;
  background: var(--project-black);
  box-shadow: inset 3px 0 0 #28d9f7, inset 0 0 18px rgba(40, 217, 247, 0.045);
}

#detailContent .project-section-tile.active small {
  color: #76ddef;
}

#detailContent .project-active-section-panel {
  margin-top: 0;
  min-height: 174px;
  padding: 10px;
  border-color: rgba(40, 217, 247, 0.2);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(6, 24, 39, 0.82), rgba(3, 15, 26, 0.9));
}

#detailContent .project-active-section-panel > .detail-section {
  margin: 0;
  padding: 0;
}

#detailContent .project-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

#detailContent .project-section-heading p {
  margin: 0 0 2px;
  color: #65e7ff;
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#detailContent .project-section-heading h3 {
  margin: 0;
}

#detailContent .project-section-heading > span {
  max-width: 58ch;
  color: #8da9ba;
  font-size: 0.65rem;
  line-height: 1.35;
  text-align: right;
}

#detailContent .project-control-grid {
  gap: 8px;
}

#detailContent .project-control-tile,
#detailContent .project-compact-note,
#detailContent .project-action-tile {
  min-height: 58px;
  padding: 8px;
  border-color: rgba(40, 217, 247, 0.18);
  border-radius: 4px;
  background: var(--project-card);
}

#detailContent .project-control-tile strong,
#detailContent .project-compact-note span {
  color: #78c7d6;
  font-size: 0.61rem;
  letter-spacing: 0.07em;
}

#detailContent .project-control-tile small {
  color: #748fa1;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.25;
}

#detailContent .project-control-tile select,
#detailContent .project-control-tile input,
#detailContent .project-compact-note textarea {
  min-height: 34px;
  border-color: rgba(40, 217, 247, 0.24);
  border-radius: 4px;
  background: #03101c;
}

#detailContent .project-assignment-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: stretch;
}

#detailContent .project-assignment-row #saveAssignmentUpdate {
  width: auto;
  min-width: 142px;
  min-height: 58px;
  margin: 0;
  padding: 7px 12px;
}

#detailContent .project-workflow-row {
  grid-template-columns: minmax(155px, 0.8fr) minmax(155px, 0.8fr) minmax(220px, 1.35fr) auto;
  align-items: stretch;
}

#detailContent .project-workflow-row .project-action-tile {
  width: auto;
  min-width: 138px;
  margin: 0;
}

#detailContent .project-active-section-panel button:not(.project-section-tile),
#detailContent .project-collapsible-section button {
  border: 1px solid rgba(77, 197, 255, 0.54);
  border-radius: 4px;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(8, 127, 202, 0.96), rgba(7, 93, 155, 0.96));
}

#detailContent .project-active-section-panel button:not(.project-section-tile):active,
#detailContent .project-collapsible-section button:active {
  border-color: #39dffb;
  background: var(--project-black);
}

#detailContent .project-active-section-panel button:disabled,
#detailContent .project-collapsible-section button:disabled {
  color: #7792a4;
  border-color: rgba(94, 122, 143, 0.28);
  background: #07131f;
}

#detailContent .project-collapsible-section {
  margin-top: 8px;
  padding: 0;
  border: 1px solid rgba(40, 217, 247, 0.17);
  border-radius: 5px;
  background: rgba(5, 20, 33, 0.78);
  overflow: hidden;
}

#detailContent .project-collapsible-section > summary {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 9px 12px;
  color: #edfaff;
  cursor: pointer;
  list-style: none;
  background: rgba(7, 31, 49, 0.8);
}

#detailContent .project-collapsible-section > summary::-webkit-details-marker {
  display: none;
}

#detailContent .project-collapsible-section > summary::after {
  content: "+";
  position: absolute;
  right: 12px;
  top: 50%;
  color: #5de6ff;
  font-size: 1rem;
  font-weight: 900;
  transform: translateY(-50%);
}

#detailContent .project-collapsible-section[open] > summary::after {
  content: "–";
}

#detailContent .project-collapsible-section > summary span {
  font-size: 0.72rem;
  font-weight: 900;
}

#detailContent .project-collapsible-section > summary small {
  color: #7f9caf;
  font-size: 0.61rem;
  font-weight: 700;
}

#detailContent .project-collapsible-content {
  padding: 10px;
  border-top: 1px solid rgba(40, 217, 247, 0.12);
}

#detailContent .followup-editor {
  gap: 8px;
}

#detailContent .followup-editor textarea {
  min-height: 64px;
}

@media (max-width: 1080px) {
  #detailContent .project-detail-workspace {
    grid-template-columns: minmax(0, 1fr) 204px;
  }

  #detailContent .project-workflow-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .detail-panel {
    padding: 10px;
  }

  .detail-panel > #detailContent {
    width: 100%;
    max-height: 97vh;
    padding: 10px;
  }

  #detailContent .detail-head {
    top: -10px;
    margin: -10px -10px 8px;
  }

  #detailContent .project-summary-section .detail-facts,
  #detailContent .project-summary-section .detail-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #detailContent .project-summary-section .detail-facts label:nth-child(n) {
    border-right: 1px solid rgba(40, 217, 247, 0.14);
    border-bottom: 1px solid rgba(40, 217, 247, 0.14);
  }

  #detailContent .project-summary-section .detail-facts label:nth-child(2n) {
    border-right: 0;
  }

  #detailContent .project-summary-section .detail-facts label:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  #detailContent .priority-editor {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  #detailContent .priority-editor .workflow-save-button {
    grid-column: 1 / -1;
  }

  #detailContent .project-detail-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "actions"
      "main";
  }

  #detailContent .project-section-tile-grid.project-action-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #detailContent .project-section-tile-grid.project-action-rail::before {
    grid-column: 1 / -1;
  }

  #detailContent .project-section-heading {
    align-items: start;
    flex-direction: column;
  }

  #detailContent .project-section-heading > span {
    text-align: left;
  }

  #detailContent .project-assignment-row,
  #detailContent .project-workflow-row,
  #detailContent .project-control-grid,
  #detailContent .project-completion-row,
  #detailContent .project-lifecycle-row {
    grid-template-columns: 1fr;
  }

  #detailContent .project-assignment-row #saveAssignmentUpdate,
  #detailContent .project-workflow-row .project-action-tile {
    width: 100%;
    min-height: 40px;
  }
}

@media (max-width: 520px) {
  #detailContent .detail-head > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  #detailContent .project-section-tile-grid.project-action-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
  }

  #detailContent .project-section-tile {
    min-height: 44px;
    padding: 6px 7px;
  }

  #detailContent .project-section-tile small {
    display: none;
  }

  #detailContent .priority-editor,
  #detailContent .project-summary-section .detail-facts,
  #detailContent .project-summary-section .detail-summary-strip {
    grid-template-columns: 1fr;
  }

  #detailContent .project-summary-section .detail-facts label:nth-child(n) {
    border-right: 0;
    border-bottom: 1px solid rgba(40, 217, 247, 0.14);
  }

  #detailContent .project-summary-section .detail-facts label:last-child {
    border-bottom: 0;
  }
}


/* Phase 41G.1 — Save button visual state
   Blue before/actionable; black only after a successful save. */
#detailContent #saveWorkflowUpdate,
#detailContent #saveAssignmentUpdate {
  color: #ffffff;
  border-color: rgba(88, 205, 255, 0.78);
  background: linear-gradient(145deg, #2f5fb8, #244d9a);
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(40, 217, 247, 0.05);
  opacity: 1;
}

#detailContent #saveWorkflowUpdate:disabled:not(.is-save-complete),
#detailContent #saveAssignmentUpdate:disabled:not(.is-save-complete) {
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(88, 205, 255, 0.42);
  background: linear-gradient(145deg, rgba(47, 95, 184, 0.7), rgba(36, 77, 154, 0.72));
  opacity: 1;
  cursor: not-allowed;
}

#detailContent #saveWorkflowUpdate.is-save-complete,
#detailContent #saveWorkflowUpdate.is-save-complete:disabled,
#detailContent #saveAssignmentUpdate.is-save-complete,
#detailContent #saveAssignmentUpdate.is-save-complete:disabled {
  color: #ffffff;
  border-color: #39dffb;
  background: #02070f;
  box-shadow:
    inset 3px 0 0 #28d9f7,
    inset 0 0 18px rgba(40, 217, 247, 0.05);
  opacity: 1;
}

/* ==========================================================================
   PHASE UI — LIGHT PROFESSIONAL OPERATIONS + STAFF MONITOR
   Presentation-only override layer. Workflow, data, permissions, assignment,
   notification, audit, commission and import behavior remain unchanged.
   ========================================================================== */
:root {
  --ui-bg: #f4f7f8;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8fbfb;
  --ui-border: #dce6e7;
  --ui-border-strong: #c8d8da;
  --ui-text: #17353b;
  --ui-muted: #6f8489;
  --ui-teal: #0f9f91;
  --ui-teal-dark: #087c73;
  --ui-teal-soft: #e7f7f4;
  --ui-shadow: 0 10px 28px rgba(24, 58, 64, 0.08);
  --ui-radius: 16px;
}

body,
body.app-active,
.app-shell {
  background: var(--ui-bg);
  color: var(--ui-text);
}

.sidebar {
  background: #ffffff;
  color: var(--ui-text);
  border-right: 1px solid var(--ui-border);
  box-shadow: 8px 0 28px rgba(24, 58, 64, 0.04);
}

.sidebar .brand {
  min-height: 76px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ui-border);
  background: #ffffff;
}

.sidebar .brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.sidebar .brand span {
  color: var(--ui-text);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sidebar-control {
  display: none !important;
}

.nav-list {
  padding: 12px 10px 20px;
  gap: 4px;
}

.nav-item {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  color: #557075;
  background: transparent;
  font-weight: 650;
  text-align: left;
}

.nav-item:hover {
  color: var(--ui-teal-dark);
  background: var(--ui-surface-soft);
}

.nav-item.active {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #c9ece7;
  box-shadow: none;
}

.sidebar-footer {
  color: var(--ui-muted);
  background: #ffffff;
  border-top: 1px solid var(--ui-border);
}

.topbar {
  min-height: 82px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--ui-border);
  box-shadow: 0 5px 18px rgba(24, 58, 64, 0.04);
  backdrop-filter: blur(12px);
}

.topbar-title img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.topbar-title h1,
.section-head h2 {
  color: var(--ui-text);
  letter-spacing: -0.025em;
}

.topbar-subtitle,
.eyebrow,
.section-head span,
.muted {
  color: var(--ui-muted);
}

.topbar-actions .ghost-button,
.topbar-actions .primary-button,
.app-language-control {
  min-height: 40px;
  border-radius: 10px;
}

.primary-button {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  box-shadow: 0 5px 14px rgba(15, 159, 145, 0.18);
}

.primary-button:hover {
  background: var(--ui-teal-dark);
  border-color: var(--ui-teal-dark);
}

.ghost-button,
.icon-button {
  color: #49666c;
  background: #ffffff;
  border: 1px solid var(--ui-border-strong);
  box-shadow: none;
}

.main {
  padding: 24px;
  background: var(--ui-bg);
}

.module-tabs {
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 13px;
  box-shadow: 0 5px 16px rgba(24, 58, 64, 0.04);
}

.module-tab {
  padding: 9px 13px;
  color: #667d82;
  border-radius: 9px;
}

#detailContent .detail-assignment-section .stage-editor {
  background: #f8fbfb;
  border-color: var(--ui-border);
  border-radius: 11px;
}

#detailContent .detail-assignment-section .stage-editor strong {
  color: #587176;
}

#detailContent #saveAssignmentUpdate:not(:disabled) {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  box-shadow: 0 5px 14px rgba(15, 159, 145, 0.18);
}

.module-tab.active {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  box-shadow: none;
}

section:not(.mobile-module-strip):not(.mobile-module-menu),
.dashboard-panel,
.detail-section,
.pending-work-panel,
.overdue-jobs-panel,
.staff-report-panel,
.document-control-panel,
.completed-projects-panel,
.daily-review-panel,
.staff-my-work-panel,
.staff-monitor-panel,
.work-intake-panel {
  border-color: var(--ui-border);
}

.pending-work-panel,
.overdue-jobs-panel,
.staff-report-panel,
.document-control-panel,
.completed-projects-panel,
.daily-review-panel,
.staff-my-work-panel,
.staff-monitor-panel,
.work-intake-panel,
.workspace {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}

.section-head {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #edf2f3;
}

.small-pill {
  color: #567177;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
}

/* Combined Project Register & Active Work Queue */
.overdue-jobs-panel {
  margin-top: 18px;
}

.work-queue-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(5, minmax(145px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: #f8fbfb;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
}

.filters label,
.detail-facts label,
.stage-editor,
.followup-editor label {
  color: #5a7277;
}

input,
select,
textarea {
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-border-strong);
  border-radius: 10px;
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ui-teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 159, 145, 0.12);
}

.bulk-action-bar {
  padding: 12px;
  margin: 14px 0;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  box-shadow: none;
}

.bulk-action-bar select {
  flex: 1 1 160px;
  width: auto;
  min-width: 145px;
}

.bulk-action-bar textarea {
  flex: 1.4 1 220px;
  width: auto;
  min-width: 190px;
  min-height: 40px;
}

.table-wrap,
.compact-work-queue {
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
}

table {
  color: var(--ui-text);
  background: #ffffff;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #557075;
  background: #f5f9f9;
  border-bottom: 1px solid var(--ui-border);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
}

tbody td {
  color: #29474d;
  border-bottom: 1px solid #edf2f3;
}

tbody tr:hover td {
  background: #f8fbfb;
}

tbody tr.selected td {
  background: var(--ui-teal-soft);
}

.status-pill,
.lifecycle-pill,
.priority-pill,
.overdue-delay {
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  letter-spacing: 0;
}

.status-pill.pending {
  color: #9a6306;
  background: #fff4dd;
  border-color: #f1ddb5;
}

.status-pill.processing {
  color: #2769a8;
  background: #e8f2ff;
  border-color: #cfe1f5;
}

.status-pill.rejected {
  color: #a43e3e;
  background: #fdeaea;
  border-color: #f1caca;
}

.status-pill.done {
  color: #257a58;
  background: #e8f7ef;
  border-color: #cce9da;
}

.lifecycle-pill.hold {
  color: #a46009;
  background: #fff1df;
  border-color: #edd3ad;
}

.lifecycle-pill.dropped {
  color: #6c7779;
  background: #f1f3f4;
  border-color: #dce1e2;
}

.lifecycle-pill.active {
  color: #257a58;
  background: #e8f7ef;
  border-color: #cce9da;
}

/* Compact stage shortcuts */
.stage-shortcut-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pending-work-panel.stage-shortcuts-collapsed .pending-work-grid {
  display: none !important;
}

.pending-work-panel.stage-shortcuts-collapsed .section-head {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.pending-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.pending-department {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  box-shadow: none;
}

.pending-department > header {
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ui-text);
  background: #f8fbfb;
}

.pending-department > header strong {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
}

.pending-work-item,
.pending-work-summary {
  color: var(--ui-text);
  background: #ffffff;
}

.pending-work-summary:hover {
  background: #f7fbfa;
}

/* Staff Monitor: horizontal employee cards with one selected detail */
.staff-monitor-note {
  color: var(--ui-muted);
}

.staff-monitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.staff-monitor-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
}

.staff-monitor-person {
  flex: 0 0 220px;
  min-height: 104px;
  padding: 14px;
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(24, 58, 64, 0.05);
  scroll-snap-align: start;
}

.staff-monitor-person:hover {
  color: var(--ui-text);
  background: #f8fbfb;
  border-color: #b8dad6;
}

.staff-monitor-person.active,
.staff-monitor-person[aria-pressed="true"] {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #8bd2c9;
  box-shadow: inset 0 3px 0 var(--ui-teal);
}

.staff-monitor-person span,
.staff-monitor-person em,
.staff-monitor-card span,
.staff-monitor-profile span,
.staff-monitor-profile em,
.staff-monitor-job span,
.staff-monitor-job small {
  color: var(--ui-muted);
}

.staff-monitor-detail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.staff-monitor-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.staff-monitor-profile,
.staff-monitor-card,
.staff-monitor-job {
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  box-shadow: none;
}

.staff-monitor-profile {
  background: #f8fbfb;
  border-color: #c9e6e2;
}

.staff-monitor-card {
  background: #ffffff;
}

.staff-monitor-job {
  grid-template-columns: minmax(200px, 1.3fr) minmax(150px, 1fr) minmax(120px, 0.75fr) minmax(100px, 0.65fr) minmax(150px, 1fr) minmax(90px, 0.55fr) auto;
  align-items: center;
}

/* Project detail: professional light drawer */
.detail-panel {
  background: var(--ui-bg);
  border-left: 1px solid var(--ui-border);
  box-shadow: -18px 0 45px rgba(24, 58, 64, 0.14);
}

.panel-hide-button {
  display: none !important;
}

.detail-content {
  padding: 18px;
  background: var(--ui-bg);
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 12;
  padding: 4px 0 14px;
  background: rgba(244, 247, 248, 0.96);
  border-bottom: 1px solid var(--ui-border);
  backdrop-filter: blur(12px);
}

.detail-head .icon-button {
  width: 40px;
  height: 40px;
  color: #526b70;
  border-radius: 10px;
}

.detail-title-input {
  padding-left: 0;
  color: var(--ui-text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  font-size: 24px;
  font-weight: 800;
}

.detail-title-input:focus {
  border-bottom-color: var(--ui-teal);
  box-shadow: none;
}

.project-summary-section,
.project-active-section-panel,
.project-collapsible-section {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(24, 58, 64, 0.05);
}

.project-summary-section {
  padding: 16px;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.detail-summary-strip {
  background: #f7fbfa;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
}

.core-edit-actions {
  order: 20;
  justify-content: flex-end;
  padding-top: 14px;
  margin-top: 14px;
  background: transparent;
  border-top: 1px solid var(--ui-border);
}

.core-edit-actions > span {
  margin-right: auto;
  color: var(--ui-muted);
}

.project-detail-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 14px;
  align-items: start;
}

.project-action-rail {
  position: sticky;
  top: 78px;
  grid-row: 1;
  grid-column: 2;
  display: grid;
  gap: 7px;
}

.project-detail-main-column {
  grid-row: 1;
  grid-column: 1;
  min-width: 0;
}

.project-section-tile {
  padding: 10px 11px;
  color: #587176;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  box-shadow: none;
}

.project-section-tile:hover {
  color: var(--ui-teal-dark);
  background: #f8fbfb;
}

.project-section-tile.active {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #c6e9e4;
}

.project-section-tile small {
  color: var(--ui-muted);
}

.project-section-panel {
  padding: 18px;
  background: #ffffff;
  border: 0;
  box-shadow: none;
}

.project-section-heading {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ui-border);
}

.project-control-tile {
  background: #f8fbfb;
  border: 1px solid var(--ui-border);
  border-radius: 11px;
  box-shadow: none;
}

.project-action-tile.workflow-save-button,
#saveCoreDetails,
#savePriorityUpdate {
  justify-self: end;
  align-self: end;
  min-width: 150px;
}

.priority-editor {
  background: #f8fbfb;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
}

.project-collapsible-section summary {
  color: var(--ui-text);
  background: #ffffff;
  border-radius: 13px;
}

.notification-panel {
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
}

@media (max-width: 1200px) {
  .work-queue-filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

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

  .staff-monitor-summary {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .staff-monitor-job {
    grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(110px, 0.7fr));
  }
}

@media (max-width: 760px) {
  .main {
    padding: 12px;
  }

  .topbar {
    min-height: 68px;
  }

  .topbar-title img {
    width: 36px;
    height: 36px;
  }

  .topbar-title h1 {
    font-size: 18px;
  }

  .topbar-subtitle {
    display: none;
  }

  .work-queue-filters,
  .bulk-action-bar {
    grid-template-columns: 1fr;
  }

  .bulk-action-bar select,
  .bulk-action-bar textarea {
    flex-basis: 100%;
    width: 100%;
  }

  .pending-work-grid,
  .staff-monitor-summary,
  .staff-monitor-job {
    grid-template-columns: 1fr;
  }

  .staff-monitor-person {
    flex-basis: min(220px, 78vw);
  }

  .detail-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .detail-content {
    padding: 12px;
  }

  .detail-facts {
    grid-template-columns: 1fr 1fr;
  }

  .project-detail-workspace {
    display: flex;
    flex-direction: column;
  }

  .project-action-rail {
    position: static;
    order: 0;
    display: flex;
    gap: 8px;
    width: 100%;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .project-section-tile {
    min-width: 145px;
  }

  .project-detail-main-column {
    order: 1;
    width: 100%;
  }

  .stage-shortcut-head-actions {
    justify-content: space-between;
    width: 100%;
  }
}

/* Today / Daily Review light cards */
.daily-review-card,
.daily-review-list-panel,
.daily-review-list {
  color: var(--ui-text);
  background: #ffffff;
  border-color: var(--ui-border);
  box-shadow: none;
}

.daily-review-card:hover,
.daily-review-list-panel:hover {
  background: #f8fbfb;
  border-color: #c9e6e2;
}

.daily-review-card span,
.daily-review-card small,
.daily-review-card p,
.daily-review-list-panel span,
.daily-review-list-panel small,
.daily-review-list span,
.daily-review-list small {
  color: var(--ui-muted);
}

.daily-review-list-panel h3,
.daily-review-list-panel strong,
.daily-review-list strong {
  color: var(--ui-text);
}

.daily-review-list-panel > header,
.daily-review-list > header {
  background: #f8fbfb;
  border-bottom-color: var(--ui-border);
}

/* Phase 41G project-detail specificity reset for the light interface */
.detail-panel > #detailContent {
  background: var(--ui-bg);
  background-image: none;
  border-color: var(--ui-border);
  border-radius: 16px;
  box-shadow: 0 30px 84px rgba(24, 58, 64, 0.2);
}

#detailContent .detail-head {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: var(--ui-border);
}

#detailContent .detail-head .eyebrow {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #c9e6e2;
}

#detailContent .detail-title-input {
  color: var(--ui-text);
}

#detailContent #closeDetail {
  color: #49666c;
  background: #ffffff;
  border-color: var(--ui-border-strong);
}

#detailContent .project-summary-section {
  background: #ffffff;
  border-color: var(--ui-border);
  border-radius: 14px;
}

#detailContent .project-summary-section > h3 {
  color: var(--ui-teal-dark);
}

#detailContent .project-summary-section .detail-facts {
  border-color: var(--ui-border);
}

#detailContent .project-summary-section .detail-facts label:nth-child(n) {
  background: #f8fbfb;
  border-right-color: var(--ui-border);
  border-bottom-color: var(--ui-border);
}

#detailContent .project-summary-section .detail-facts span,
#detailContent .detail-summary-strip strong,
#detailContent .priority-editor span {
  color: var(--ui-muted);
}

#detailContent .project-summary-section .detail-facts input {
  color: var(--ui-text);
}

#detailContent .core-edit-actions {
  background: #ffffff;
  border-color: var(--ui-border);
}

#detailContent .project-summary-section .detail-summary-strip span {
  background: #f8fbfb;
  border-color: var(--ui-border);
}

#detailContent .detail-summary-strip em {
  color: var(--ui-text);
}

#detailContent .priority-editor {
  background: #f8fbfb;
  border-color: var(--ui-border);
}

#detailContent .project-section-tile-grid.project-action-rail {
  background: #ffffff;
  border-color: var(--ui-border);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(24, 58, 64, 0.08);
}

#detailContent .project-section-tile-grid.project-action-rail::before {
  color: var(--ui-teal-dark);
}

#detailContent .project-section-tile {
  color: #587176;
  background: #ffffff;
  border-color: var(--ui-border);
  border-radius: 10px;
  clip-path: none;
}

#detailContent .project-section-tile small {
  color: var(--ui-muted);
}

#detailContent .project-section-tile:hover,
#detailContent .project-section-tile:focus-visible {
  color: var(--ui-teal-dark);
  background: #f8fbfb;
  border-color: #b8dad6;
}

#detailContent .project-section-tile.active {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #8bd2c9;
  box-shadow: inset 3px 0 0 var(--ui-teal);
}

#detailContent .project-section-tile.active small {
  color: var(--ui-teal-dark);
}

#detailContent .project-active-section-panel {
  background: #ffffff;
  border-color: var(--ui-border);
  border-radius: 14px;
}

#detailContent .project-section-heading p {
  color: var(--ui-teal-dark);
}

#detailContent .project-section-heading > span {
  color: var(--ui-muted);
}

#detailContent .project-control-tile,
#detailContent .project-compact-note,
#detailContent .project-action-tile {
  background: #f8fbfb;
  border-color: var(--ui-border);
  border-radius: 11px;
}

#detailContent .project-control-tile strong,
#detailContent .project-compact-note span {
  color: #587176;
}

#detailContent .project-control-tile small {
  color: var(--ui-muted);
}

#detailContent .project-control-tile select,
#detailContent .project-control-tile input,
#detailContent .project-compact-note textarea {
  color: var(--ui-text);
  background: #ffffff;
  border-color: var(--ui-border-strong);
  border-radius: 9px;
}

#detailContent .project-active-section-panel button:not(.project-section-tile),
#detailContent .project-collapsible-section button {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  border-radius: 9px;
}

#detailContent .project-active-section-panel button:not(.project-section-tile):active,
#detailContent .project-collapsible-section button:active {
  background: var(--ui-teal-dark);
  border-color: var(--ui-teal-dark);
}

#detailContent .project-active-section-panel button:disabled,
#detailContent .project-collapsible-section button:disabled {
  color: #7b8d91;
  background: #eef2f3;
  border-color: var(--ui-border);
}

#detailContent .project-collapsible-section {
  background: #ffffff;
  border-color: var(--ui-border);
  border-radius: 12px;
}

#detailContent .project-collapsible-section > summary {
  color: var(--ui-text);
  background: #ffffff;
}

#detailContent .project-collapsible-section > summary::after {
  color: var(--ui-teal);
}

#detailContent .project-collapsible-section > summary small {
  color: var(--ui-muted);
}

#detailContent .project-collapsible-content {
  border-top-color: var(--ui-border);
}

/* Staff Monitor compact employee tabs */
.staff-monitor-list {
  gap: 6px;
  padding-bottom: 6px;
}

.staff-monitor-person {
  flex: 0 0 150px;
  min-height: 64px;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 10px;
}

.staff-monitor-person strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-monitor-person span,
.staff-monitor-person em {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .staff-monitor-person {
    flex-basis: 145px;
  }
}

@media (min-width: 761px) {
  #staffMonitorPanel .staff-monitor-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 2px 2px 4px;
    scroll-snap-type: none;
  }

  #staffMonitorPanel .staff-monitor-person {
    flex: none;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 6px 8px;
    scroll-snap-align: none;
  }
}

/* Project detail action color and tab alignment refinement */
#detailContent .project-section-tile-grid.project-action-rail {
  align-content: start;
  gap: 7px;
  padding: 8px;
}

#detailContent .project-section-tile-grid.project-action-rail::before {
  display: flex;
  min-height: 24px;
  align-items: center;
  padding: 0 4px;
}

#detailContent .project-section-tile {
  display: flex;
  width: 100%;
  height: 44px;
  min-height: 44px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: 6px 10px;
  border-radius: 9px;
  text-align: left;
}

#detailContent .project-section-tile span,
#detailContent .project-section-tile small {
  width: 100%;
  line-height: 1.15;
  text-align: left;
}

#detailContent #saveCoreDetails:not(:disabled),
#detailContent #savePriorityUpdate:not(:disabled),
#detailContent #saveWorkflowUpdate:not(:disabled),
#detailContent #saveAssignmentUpdate:not(:disabled) {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  box-shadow: 0 5px 14px rgba(15, 159, 145, 0.18);
}

#detailContent #saveCoreDetails:hover:not(:disabled),
#detailContent #savePriorityUpdate:hover:not(:disabled),
#detailContent #saveWorkflowUpdate:hover:not(:disabled),
#detailContent #saveAssignmentUpdate:hover:not(:disabled) {
  background: var(--ui-teal-dark);
  border-color: var(--ui-teal-dark);
}

#detailContent #saveCoreDetails:disabled,
#detailContent #savePriorityUpdate:disabled,
#detailContent #saveWorkflowUpdate:disabled:not(.is-save-complete),
#detailContent #saveAssignmentUpdate:disabled:not(.is-save-complete) {
  color: #60767b;
  background: #edf2f3;
  border-color: var(--ui-border);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

#detailContent #saveWorkflowUpdate.is-save-complete,
#detailContent #saveAssignmentUpdate.is-save-complete {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #8bd2c9;
  box-shadow: inset 3px 0 0 var(--ui-teal);
}

#detailContent #closeDetail {
  color: var(--ui-teal-dark);
}

#detailContent #closeDetail:hover,
#detailContent #closeDetail:focus-visible {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #8bd2c9;
}

#detailContent .project-collapsible-section > summary::after {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--ui-teal-dark);
  font-size: 16px;
  line-height: 1;
}

@media (max-width: 520px) {
  #detailContent .project-section-tile-grid.project-action-rail {
    padding: 6px;
  }

  #detailContent .project-section-tile {
    padding: 6px 7px;
  }
}

/* Project Actions wrapped horizontal grid */
#detailContent .project-detail-workspace {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "actions"
    "main";
  gap: 10px;
}

#detailContent .project-section-tile-grid.project-action-rail {
  position: static;
  top: auto;
  display: grid;
  grid-area: actions;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  width: 100%;
  align-items: stretch;
  align-content: start;
  gap: 7px;
  margin: 0;
  padding: 7px 8px 8px;
  overflow: visible;
}

#detailContent .project-section-tile-grid.project-action-rail.hidden {
  display: none;
}

#detailContent .project-section-tile-grid.project-action-rail .project-section-tile.hidden {
  display: none !important;
}

#detailContent .project-section-tile-grid.project-action-rail::before {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 22px;
  padding: 0 4px;
  white-space: nowrap;
}

#detailContent .project-section-tile-grid.project-action-rail .project-section-tile {
  width: 100%;
  height: auto;
  min-height: 44px;
  min-width: 0;
  max-width: none;
  padding: 6px 7px;
}

#detailContent .project-section-tile-grid.project-action-rail .project-section-tile span {
  font-size: 0.68rem;
}

#detailContent .project-section-tile-grid.project-action-rail .project-section-tile small {
  font-size: 0.54rem;
}

#detailContent .project-detail-main-column {
  grid-area: main;
  grid-row: auto;
  grid-column: auto;
  width: 100%;
}

@media (max-width: 1180px) {
  #detailContent .project-section-tile-grid.project-action-rail {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #detailContent .project-section-tile-grid.project-action-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #detailContent .project-section-tile-grid.project-action-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
  }

  #detailContent .project-section-tile-grid.project-action-rail .project-section-tile {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

/* Commission Control compact professional layout */
.commission-control-panel {
  gap: 9px;
  padding: 12px;
  border-color: var(--ui-border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(24, 58, 64, 0.05);
}

.commission-control-panel > .section-head {
  min-height: 0;
  gap: 10px;
  padding-bottom: 10px;
  margin: 0;
  border-bottom: 1px solid var(--ui-border);
}

.commission-control-panel > .section-head h2 {
  font-size: 1.05rem;
}

.commission-control-panel > .section-head span {
  font-size: 0.78rem;
}

.commission-control-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.commission-control-summary article {
  gap: 2px;
  min-height: 52px;
  padding: 7px 9px;
  background: #f8fbfb;
  border-color: var(--ui-border);
  border-radius: 8px;
}

.commission-control-summary span,
.commission-control-meta strong {
  font-size: 0.64rem;
}

.commission-control-summary strong {
  font-size: 0.92rem;
  line-height: 1.1;
}

.commission-control-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(170px, 240px);
  gap: 8px;
}

.commission-control-filters label {
  gap: 3px;
}

.commission-control-filters label > span {
  font-size: 0.65rem;
}

.commission-control-filters input,
.commission-control-filters select {
  height: 36px;
  min-height: 36px;
  padding: 6px 9px;
  border-color: var(--ui-border-strong);
  border-radius: 8px;
  background: #ffffff;
}

.commission-control-grid {
  gap: 6px;
}

.commission-control-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(0, 6fr) auto;
  align-items: center;
  gap: 8px 10px;
  min-height: 0;
  padding: 8px 10px;
  background: #ffffff;
  border-color: var(--ui-border);
  border-radius: 8px;
}

.commission-control-card-main {
  display: grid;
  align-content: center;
  align-items: start;
  justify-content: stretch;
  gap: 3px;
}

.commission-control-card-main > div {
  display: grid;
  gap: 1px;
}

.commission-control-card-main > div > strong {
  font-size: 0.84rem;
  line-height: 1.1;
}

.commission-control-card-main > div > span {
  overflow: hidden;
  font-size: 0.67rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-control-card-main > .small-pill {
  justify-self: start;
  padding: 3px 7px;
  font-size: 0.62rem;
  line-height: 1.1;
}

.commission-control-meta {
  grid-template-columns: repeat(10, minmax(62px, 1fr));
  align-items: center;
  gap: 5px 7px;
}

.commission-control-meta span {
  gap: 2px;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.15;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-control-meta strong {
  overflow: hidden;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-control-card > p {
  grid-column: 2;
  overflow: hidden;
  font-size: 0.67rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-control-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  flex-wrap: wrap;
  gap: 5px;
}

.commission-control-actions .compact-button {
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.68rem;
  white-space: nowrap;
}

[data-theme="light"] .nav-item.active {
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #c9ece7;
  box-shadow: none;
}

[data-theme="light"] .primary-button {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  box-shadow: 0 5px 14px rgba(15, 159, 145, 0.18);
}

[data-theme="light"] .primary-button:hover {
  background: var(--ui-teal-dark);
  border-color: var(--ui-teal-dark);
}

@media (max-width: 1450px) {
  .commission-control-meta {
    grid-template-columns: repeat(5, minmax(80px, 1fr));
  }
}

@media (max-width: 1180px) {
  .commission-control-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .commission-control-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .commission-control-card-main {
    grid-column: 1;
    grid-row: 1;
  }

  .commission-control-meta {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .commission-control-card > p {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .commission-control-actions {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 700px) {
  .commission-control-panel {
    padding: 10px;
  }

  .commission-control-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commission-control-filters,
  .commission-control-card {
    grid-template-columns: 1fr;
  }

  .commission-control-card-main,
  .commission-control-meta,
  .commission-control-card > p,
  .commission-control-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .commission-control-card > p {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .commission-control-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commission-control-actions {
    justify-content: flex-start;
  }
}

/* CEO Today operational command center */
#dailyReviewPanel {
  margin-bottom: 18px;
  overflow: hidden;
  color: var(--ui-text);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--ui-shadow);
}

#dailyReviewPanel > .section-head {
  min-height: 0;
  margin-bottom: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--ui-border);
}

#dailyReviewPanel > .section-head .eyebrow {
  margin-bottom: 3px;
  color: var(--ui-teal-dark);
  font-size: 10px;
  letter-spacing: 0.08em;
}

#dailyReviewPanel > .section-head h2 {
  font-size: 18px;
  line-height: 1.2;
}

#dailyReviewPanel #dailyReviewTotal {
  color: #a8323d;
  background: #fff0f1;
  border-color: #f4cfd3;
}

#dailyReviewPanel .daily-review-cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px;
}

#dailyReviewPanel .daily-review-card {
  position: relative;
  min-width: 0;
  min-height: 82px;
  gap: 4px;
  overflow: hidden;
  padding: 10px 11px 9px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#dailyReviewPanel .daily-review-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--ui-teal);
  content: "";
}

#dailyReviewPanel .daily-review-card.red::before {
  background: #d84c59;
}

#dailyReviewPanel .daily-review-card.orange::before {
  background: #e4a527;
}

#dailyReviewPanel .daily-review-card.green::before {
  background: #22a673;
}

#dailyReviewPanel .daily-review-card span {
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

#dailyReviewPanel .daily-review-card strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--ui-teal-dark);
  font-size: 21px;
  line-height: 1.05;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#dailyReviewPanel .daily-review-card.red strong {
  color: #bf2f3d;
}

#dailyReviewPanel .daily-review-card.orange strong {
  color: #b66a00;
}

#dailyReviewPanel .daily-review-card.green strong {
  color: #117e5a;
}

#dailyReviewPanel .daily-review-card.blue strong {
  color: var(--ui-teal-dark);
}

#dailyReviewPanel .daily-review-card small {
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dailyReviewPanel .today-ceo-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 14px;
}

#dailyReviewPanel .today-ceo-panel {
  min-width: 0;
  min-height: 244px;
  overflow: hidden;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
}

#dailyReviewPanel .today-ceo-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px 10px;
  background: var(--ui-surface-soft);
  border-bottom: 1px solid var(--ui-border);
}

#dailyReviewPanel .today-ceo-panel h3,
#dailyReviewPanel .today-ceo-action-heading h3 {
  margin: 2px 0 0;
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.2;
}

#dailyReviewPanel .today-ceo-panel > header small,
#dailyReviewPanel .today-ceo-action-heading > small {
  color: var(--ui-muted);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: right;
}

#dailyReviewPanel .today-ceo-panel-kicker {
  color: var(--ui-teal-dark);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#dailyReviewPanel .today-ceo-stage-load,
#dailyReviewPanel .today-ceo-delay-aging,
#dailyReviewPanel .today-ceo-staff-load {
  display: grid;
  gap: 9px;
  padding: 11px 12px 12px;
}

#dailyReviewPanel .today-ceo-bar-row {
  display: grid;
  gap: 4px;
}

#dailyReviewPanel .today-ceo-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

#dailyReviewPanel .today-ceo-bar-label span {
  overflow: hidden;
  color: var(--ui-text);
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dailyReviewPanel .today-ceo-bar-label strong {
  flex: 0 0 auto;
  color: var(--ui-teal-dark);
  font-size: 11px;
}

#dailyReviewPanel .today-ceo-bar-track,
#dailyReviewPanel .today-ceo-aging-track,
#dailyReviewPanel .today-ceo-staff-track {
  height: 5px;
  overflow: hidden;
  background: #e8eff0;
  border-radius: 999px;
}

#dailyReviewPanel .today-ceo-bar-track > span,
#dailyReviewPanel .today-ceo-aging-track > span,
#dailyReviewPanel .today-ceo-staff-track > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ui-teal-dark), var(--ui-teal));
  border-radius: inherit;
}

#dailyReviewPanel .today-ceo-aging-row {
  display: grid;
  gap: 5px;
  padding: 6px 8px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

#dailyReviewPanel .today-ceo-aging-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#dailyReviewPanel .today-ceo-aging-row span {
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 800;
}

#dailyReviewPanel .today-ceo-aging-row strong {
  color: var(--ui-teal-dark);
  font-size: 13px;
}

#dailyReviewPanel .today-ceo-aging-row.risk strong {
  color: #b66a00;
}

#dailyReviewPanel .today-ceo-aging-row.risk .today-ceo-aging-track > span {
  background: #e4a527;
}

#dailyReviewPanel .today-ceo-aging-row.critical strong {
  color: #bf2f3d;
}

#dailyReviewPanel .today-ceo-aging-row.critical .today-ceo-aging-track > span {
  background: #d84c59;
}

#dailyReviewPanel .today-ceo-staff-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(64px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px 0;
}

#dailyReviewPanel .today-ceo-staff-row + .today-ceo-staff-row {
  border-top: 1px solid #edf2f3;
}

#dailyReviewPanel .today-ceo-staff-copy {
  display: grid;
  min-width: 0;
}

#dailyReviewPanel .today-ceo-staff-copy strong {
  overflow: hidden;
  color: var(--ui-text);
  font-size: 10.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dailyReviewPanel .today-ceo-staff-copy span,
#dailyReviewPanel .today-ceo-staff-row small {
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dailyReviewPanel .today-ceo-staff-row.lead-load .today-ceo-staff-copy strong {
  color: var(--ui-teal-dark);
}

#dailyReviewPanel .today-ceo-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

#dailyReviewPanel .today-ceo-action-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 16px;
  padding: 11px 0 8px;
  border-top: 1px solid var(--ui-border);
}

#dailyReviewPanel .daily-review-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

#dailyReviewPanel .daily-review-list-panel {
  min-width: 0;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#dailyReviewPanel .daily-review-list-panel > header {
  min-height: 42px;
  padding: 9px 10px;
  background: var(--ui-surface-soft);
  border-bottom: 1px solid var(--ui-border);
}

#dailyReviewPanel .daily-review-list-panel h3 {
  color: var(--ui-text);
  font-size: 11.5px;
}

#dailyReviewPanel .daily-review-list-panel > header span {
  display: grid;
  min-width: 25px;
  min-height: 25px;
  padding: 2px 6px;
  place-items: center;
  color: var(--ui-teal-dark);
  font-size: 10px;
  background: var(--ui-teal-soft);
  border-radius: 999px;
}

#dailyReviewPanel .daily-review-list {
  gap: 7px;
  max-height: 332px;
  padding: 8px;
  overflow: auto;
  background: var(--ui-surface);
  scrollbar-color: #b9c7c9 transparent;
  scrollbar-width: thin;
}

#dailyReviewPanel .daily-review-item {
  gap: 4px;
  padding: 8px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

#dailyReviewPanel .daily-review-item:hover {
  background: var(--ui-teal-soft);
  border-color: #a9dcd6;
}

#dailyReviewPanel .daily-review-item .status-pill {
  justify-self: start;
  width: auto;
  min-width: 78px;
  min-height: 22px;
  padding: 3px 8px;
  font-size: 9px;
}

#dailyReviewPanel .daily-review-item strong {
  color: var(--ui-text);
  font-size: 11.5px;
}

#dailyReviewPanel .daily-review-item small,
#dailyReviewPanel .daily-review-item em,
#dailyReviewPanel .daily-review-empty {
  color: var(--ui-muted);
  font-size: 9.5px;
  line-height: 1.3;
}

#dailyReviewPanel .daily-review-actions {
  gap: 6px;
  margin-top: 2px;
}

#dailyReviewPanel .daily-review-open,
#dailyReviewPanel .daily-review-mark-done {
  min-height: 28px;
  padding: 4px 8px;
  color: var(--ui-teal-dark);
  font-size: 9.5px;
  background: #ffffff;
  border-color: #b9deda;
  border-radius: 7px;
}

#dailyReviewPanel .daily-review-open:not(:disabled):hover,
#dailyReviewPanel .daily-review-mark-done:not(:disabled):hover {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
}

@media (max-width: 1180px) {
  #dailyReviewPanel .daily-review-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #dailyReviewPanel .today-ceo-dashboard-grid,
  #dailyReviewPanel .daily-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dailyReviewPanel .today-ceo-staff-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #dailyReviewPanel {
    border-radius: 12px;
  }

  #dailyReviewPanel > .section-head,
  #dailyReviewPanel .daily-review-cards,
  #dailyReviewPanel .today-ceo-dashboard-grid,
  #dailyReviewPanel .daily-review-grid {
    padding-right: 10px;
    padding-left: 10px;
  }

  #dailyReviewPanel > .section-head {
    flex-direction: row;
    align-items: center;
  }

  #dailyReviewPanel #dailyReviewTotal {
    align-self: center;
    width: auto;
  }

  #dailyReviewPanel .daily-review-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dailyReviewPanel .today-ceo-dashboard-grid,
  #dailyReviewPanel .daily-review-grid {
    grid-template-columns: 1fr;
  }

  #dailyReviewPanel .today-ceo-staff-panel {
    grid-column: auto;
  }

  #dailyReviewPanel .today-ceo-action-heading {
    align-items: flex-start;
    margin-right: 10px;
    margin-left: 10px;
  }

  #dailyReviewPanel .today-ceo-staff-row {
    grid-template-columns: minmax(100px, 1fr) minmax(70px, 0.7fr);
  }

  #dailyReviewPanel .today-ceo-staff-row > small {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  #dailyReviewPanel .daily-review-cards {
    grid-template-columns: 1fr;
  }

  #dailyReviewPanel .today-ceo-action-heading {
    display: grid;
  }

  #dailyReviewPanel .today-ceo-action-heading > small {
    text-align: left;
  }
}

/* Lead CRM compact light workspace */
#workIntakePanel[data-intake-view="leads"] {
  gap: 10px;
  padding: 13px;
  color: var(--ui-text);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--ui-shadow);
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 0;
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--ui-border);
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-head .eyebrow {
  margin-bottom: 2px;
  color: var(--ui-teal-dark);
  font-size: 9px;
  letter-spacing: 0.08em;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-head h2 {
  font-size: 18px;
  line-height: 1.2;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-head-actions .small-pill {
  min-height: 32px;
  padding: 6px 10px;
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #bfe3df;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-head-actions button {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-head-actions .primary-button {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  box-shadow: 0 5px 14px rgba(15, 159, 145, 0.17);
}

#workIntakePanel[data-intake-view="leads"] .work-intake-filters {
  display: grid;
  grid-template-columns: minmax(230px, 1.55fr) repeat(4, minmax(130px, 1fr));
  align-items: end;
  gap: 8px;
  padding: 9px 10px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-filters label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-filters label > span,
#workIntakePanel[data-intake-view="leads"] .work-intake-form label > span,
#workIntakePanel[data-intake-view="leads"] .lead-conversion-form label > span {
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0.045em;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-filters input,
#workIntakePanel[data-intake-view="leads"] .work-intake-filters select,
#workIntakePanel[data-intake-view="leads"] .work-intake-form input,
#workIntakePanel[data-intake-view="leads"] .work-intake-form select,
#workIntakePanel[data-intake-view="leads"] .lead-conversion-form input,
#workIntakePanel[data-intake-view="leads"] .lead-conversion-form select {
  min-width: 0;
  min-height: 35px;
  padding: 6px 9px;
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-filters input:focus,
#workIntakePanel[data-intake-view="leads"] .work-intake-filters select:focus,
#workIntakePanel[data-intake-view="leads"] .work-intake-form input:focus,
#workIntakePanel[data-intake-view="leads"] .work-intake-form select:focus,
#workIntakePanel[data-intake-view="leads"] .work-intake-form textarea:focus,
#workIntakePanel[data-intake-view="leads"] .lead-conversion-form input:focus,
#workIntakePanel[data-intake-view="leads"] .lead-conversion-form textarea:focus {
  border-color: var(--ui-teal);
  box-shadow: 0 0 0 2px rgba(15, 159, 145, 0.1);
  outline: none;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard .lead-crm-kpi {
  position: relative;
  min-width: 0;
  min-height: 62px;
  overflow: hidden;
  padding: 8px 10px 8px 12px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  box-shadow: none;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard .lead-crm-kpi::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--ui-teal);
  content: "";
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard .lead-crm-kpi.followup::before {
  background: #e4a527;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard .lead-crm-kpi.confirmed::before {
  background: #22a673;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard .lead-crm-kpi.partner::before {
  background: #4f7fc8;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard span {
  color: var(--ui-muted);
  font-size: 9.5px;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard strong {
  margin-top: 3px;
  color: var(--ui-teal-dark);
  font-size: 20px;
  line-height: 1.05;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard .followup strong {
  color: #ad6500;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard .confirmed strong {
  color: #117e5a;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard .partner strong {
  color: #315f9e;
}

#workIntakePanel[data-intake-view="leads"] .channel-wallet-panel {
  gap: 8px;
  padding: 9px 10px;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="leads"] .channel-wallet-head {
  align-items: center;
  gap: 10px;
}

#workIntakePanel[data-intake-view="leads"] .channel-wallet-head h3 {
  margin: 1px 0 2px;
  color: var(--ui-text);
  font-size: 12px;
}

#workIntakePanel[data-intake-view="leads"] .channel-wallet-head span,
#workIntakePanel[data-intake-view="leads"] .channel-wallet-note {
  color: var(--ui-muted);
  font-size: 9.5px;
  line-height: 1.3;
}

#workIntakePanel[data-intake-view="leads"] .channel-wallet-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

#workIntakePanel[data-intake-view="leads"] .channel-wallet-grid article {
  min-width: 0;
  padding: 7px 8px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="leads"] .channel-wallet-grid span {
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 800;
}

#workIntakePanel[data-intake-view="leads"] .channel-wallet-grid strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ui-teal-dark);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 8px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-utility-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 70px;
  padding: 9px 10px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-utility-panel h3 {
  margin: 1px 0 3px;
  color: var(--ui-text);
  font-size: 12px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-utility-panel span {
  color: var(--ui-muted);
  font-size: 9.5px;
  line-height: 1.3;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-utility-panel > button {
  min-height: 32px;
  padding: 5px 9px;
  color: var(--ui-teal-dark);
  background: #ffffff;
  border-color: #b9deda;
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-utility-panel > button:not(:disabled):hover {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
}

#workIntakePanel[data-intake-view="leads"] .lead-source-mini-form {
  grid-column: 1 / -1;
  margin-top: 1px;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-form label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-form textarea,
#workIntakePanel[data-intake-view="leads"] .lead-conversion-form textarea {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
  resize: vertical;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-actions button {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-status {
  margin: 0;
  padding: 7px 9px;
  color: var(--ui-muted);
  font-size: 9.5px;
  line-height: 1.35;
  background: #fbfdfd;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="leads"] .work-intake-list {
  display: grid;
  gap: 6px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(410px, 0.82fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
  padding: 9px 10px;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  box-shadow: none;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row:hover {
  background: #fbfdfd;
  border-color: #b9deda;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row:has(.lead-crm-inline-form) {
  grid-template-columns: 1fr;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row-main {
  gap: 3px;
  min-width: 0;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row-main > strong {
  overflow: hidden;
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row-main > small {
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row-main > p {
  display: -webkit-box;
  margin: 1px 0;
  overflow: hidden;
  color: #506b71;
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row-main > .small-pill {
  justify-self: start;
  width: auto;
  min-height: 22px;
  padding: 3px 7px;
  font-size: 9px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row-controls {
  display: flex;
  align-items: center;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row-controls select {
  flex: 1 1 155px;
  width: auto;
  min-width: 135px;
  min-height: 33px;
  padding: 5px 8px;
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-border-strong);
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-row-controls select:focus {
  border-color: var(--ui-teal);
  box-shadow: 0 0 0 2px rgba(15, 159, 145, 0.1);
  outline: none;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-assignee-pill {
  flex: 0 1 auto;
  width: auto;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border-color: #c6e8e4;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-action {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 5px 9px;
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-action.primary-button {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
}

#workIntakePanel[data-intake-view="leads"] .lead-crm-inline-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 7px;
  padding: 9px;
  background: var(--ui-teal-soft);
  border: 1px solid #bfe3df;
  border-radius: 9px;
}

#workIntakePanel[data-intake-view="leads"] .lead-request-pending {
  color: #9a5b00;
  background: #fff7df;
  border-color: #eed79e;
}

#workIntakePanel[data-intake-view="leads"] .lead-request-disabled {
  color: #7b6a42;
  background: #fffaf0;
  border-color: #eadfca;
}

@media (max-width: 1180px) {
  #workIntakePanel[data-intake-view="leads"] .work-intake-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="leads"] .work-intake-filters label:has([data-intake-filter="search"]) {
    grid-column: span 2;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard,
  #workIntakePanel[data-intake-view="leads"] .channel-wallet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-row {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-row-controls {
    justify-content: flex-start;
  }

  #workIntakePanel[data-intake-view="leads"] .work-intake-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #workIntakePanel[data-intake-view="leads"] {
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-head {
    flex-direction: row;
    align-items: center;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-head-actions {
    justify-content: flex-end;
  }

  #workIntakePanel[data-intake-view="leads"] .work-intake-filters,
  #workIntakePanel[data-intake-view="leads"] .work-intake-form,
  #workIntakePanel[data-intake-view="leads"] .lead-crm-inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="leads"] .work-intake-filters label:has([data-intake-filter="search"]) {
    grid-column: 1 / -1;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard,
  #workIntakePanel[data-intake-view="leads"] .channel-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-support-grid {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-utility-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 520px) {
  #workIntakePanel[data-intake-view="leads"] .lead-crm-head {
    display: grid;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-head-actions {
    justify-content: flex-start;
  }

  #workIntakePanel[data-intake-view="leads"] .work-intake-filters,
  #workIntakePanel[data-intake-view="leads"] .work-intake-form,
  #workIntakePanel[data-intake-view="leads"] .lead-crm-inline-form,
  #workIntakePanel[data-intake-view="leads"] .lead-crm-utility-panel {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="leads"] .work-intake-filters label:has([data-intake-filter="search"]),
  #workIntakePanel[data-intake-view="leads"] .work-intake-form .wide-field,
  #workIntakePanel[data-intake-view="leads"] .lead-crm-inline-form .wide-field {
    grid-column: auto;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-utility-panel > button {
    justify-self: start;
  }

  #workIntakePanel[data-intake-view="leads"] .lead-crm-row-controls select {
    flex-basis: 100%;
  }
}

@media (max-width: 400px) {
  #workIntakePanel[data-intake-view="leads"] .lead-crm-dashboard,
  #workIntakePanel[data-intake-view="leads"] .channel-wallet-grid {
    grid-template-columns: 1fr;
  }
}

/* Service Desk compact workspace */
#workIntakePanel[data-intake-view="service"] {
  gap: 10px;
  padding: 13px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-shadow: var(--ui-shadow);
}

#workIntakePanel[data-intake-view="service"] .service-desk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--ui-border);
}

#workIntakePanel[data-intake-view="service"] .service-desk-head > div:first-child {
  min-width: 0;
}

#workIntakePanel[data-intake-view="service"] .service-desk-head .eyebrow {
  margin-bottom: 2px;
  color: var(--ui-teal-dark);
  font-size: 9px;
  letter-spacing: 0.055em;
}

#workIntakePanel[data-intake-view="service"] .service-desk-head h2 {
  margin: 0;
  color: var(--ui-text);
  font-size: 18px;
  line-height: 1.15;
}

#workIntakePanel[data-intake-view="service"] .service-desk-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-head-actions .small-pill {
  min-height: 30px;
  padding: 7px 11px;
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border: 1px solid #bfe4de;
}

#workIntakePanel[data-intake-view="service"] .service-desk-head-actions button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-head-actions .primary-button {
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  box-shadow: 0 4px 12px rgba(15, 159, 145, 0.18);
}

#workIntakePanel[data-intake-view="service"] .service-desk-head-actions .primary-button:hover {
  background: var(--ui-teal-dark);
  border-color: var(--ui-teal-dark);
}

#workIntakePanel[data-intake-view="service"] .work-intake-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(112px, 1fr));
  align-items: end;
  gap: 7px;
  padding: 9px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="service"] .work-intake-filters label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="service"] .work-intake-filters label > span,
#workIntakePanel[data-intake-view="service"] .service-desk-form label > span,
#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid label > span {
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

#workIntakePanel[data-intake-view="service"] .work-intake-filters input,
#workIntakePanel[data-intake-view="service"] .work-intake-filters select,
#workIntakePanel[data-intake-view="service"] .service-desk-form input,
#workIntakePanel[data-intake-view="service"] .service-desk-form select,
#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid input,
#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-border-strong);
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="service"] .work-intake-filters input:focus,
#workIntakePanel[data-intake-view="service"] .work-intake-filters select:focus,
#workIntakePanel[data-intake-view="service"] .service-desk-form input:focus,
#workIntakePanel[data-intake-view="service"] .service-desk-form select:focus,
#workIntakePanel[data-intake-view="service"] .service-desk-form textarea:focus,
#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid input:focus,
#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid select:focus,
#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid textarea:focus {
  border-color: var(--ui-teal);
  box-shadow: 0 0 0 2px rgba(15, 159, 145, 0.12);
  outline: none;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi {
  position: relative;
  min-width: 0;
  min-height: 63px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 11px 9px 14px;
  overflow: hidden;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ui-teal);
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi span {
  min-width: 0;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi strong {
  color: var(--ui-text);
  font-size: 21px;
  line-height: 1;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi.urgent::before,
#workIntakePanel[data-intake-view="service"] .service-desk-kpi.overdue::before {
  background: #d54d4d;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi.urgent strong,
#workIntakePanel[data-intake-view="service"] .service-desk-kpi.overdue strong {
  color: #b4232c;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi.waiting::before {
  background: #d49a24;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi.waiting strong {
  color: #986500;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi.unassigned::before {
  background: #4a78b8;
}

#workIntakePanel[data-intake-view="service"] .service-desk-kpi.unassigned strong {
  color: #315f9e;
}

#workIntakePanel[data-intake-view="service"] .service-desk-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--ui-surface-soft);
  border-color: var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-form label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-form textarea,
#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  resize: vertical;
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-border-strong);
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-form .work-intake-actions {
  align-items: center;
  gap: 7px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-form .work-intake-actions button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="service"] .work-intake-status {
  margin: -1px 1px 0;
  color: var(--ui-muted);
  font-size: 10px;
}

#workIntakePanel[data-intake-view="service"] .work-intake-list {
  gap: 7px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  background: var(--ui-surface);
  border-color: var(--ui-border);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(24, 58, 64, 0.035);
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket.is-urgent {
  border-left: 3px solid #d54d4d;
  background: #fffafa;
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket.is-overdue {
  box-shadow: inset 3px 0 0 #d97935, 0 3px 10px rgba(24, 58, 64, 0.035);
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket.is-urgent.is-overdue {
  box-shadow: none;
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket-main {
  gap: 3px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket-main > strong {
  min-width: 0;
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.2;
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket-main > small {
  min-width: 0;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket-main > p {
  min-width: 0;
  max-width: 100%;
  color: #425e64;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="service"] .service-desk-ticket-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

#workIntakePanel[data-intake-view="service"] .service-desk-status,
#workIntakePanel[data-intake-view="service"] .service-desk-priority {
  min-height: 25px;
  min-width: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="service"] .service-desk-priority {
  color: var(--ui-muted);
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
}

#workIntakePanel[data-intake-view="service"] .service-desk-action {
  min-height: 29px;
  padding: 6px 10px;
  color: var(--ui-teal-dark);
  border-color: #bcded9;
  border-radius: 7px;
  font-size: 10px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-action:hover {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
}

#workIntakePanel[data-intake-view="service"] .service-desk-detail {
  gap: 9px;
  margin-top: 7px;
  padding: 9px;
  background: var(--ui-surface-soft);
  border-color: var(--ui-border);
  border-radius: 9px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-detail-grid label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-detail-actions {
  justify-content: flex-start;
  gap: 6px;
}

#workIntakePanel[data-intake-view="service"] .service-desk-detail-actions button {
  min-height: 29px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 10px;
}

#workIntakePanel[data-intake-view="service"] .service-history,
#workIntakePanel[data-intake-view="service"] .service-internal-notes {
  gap: 6px;
}

#workIntakePanel[data-intake-view="service"] .service-history-row {
  gap: 2px;
  padding: 7px 9px;
  background: var(--ui-surface);
  border-color: var(--ui-border);
  border-radius: 7px;
}

#workIntakePanel[data-intake-view="service"] .service-history-row strong,
#workIntakePanel[data-intake-view="service"] .service-internal-notes strong {
  color: var(--ui-text);
  font-size: 10px;
}

#workIntakePanel[data-intake-view="service"] .service-history-row span,
#workIntakePanel[data-intake-view="service"] .service-history-row em,
#workIntakePanel[data-intake-view="service"] .service-internal-notes p {
  color: var(--ui-muted);
  font-size: 10px;
}

@media (max-width: 1180px) {
  #workIntakePanel[data-intake-view="service"] .work-intake-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="service"] .work-intake-filters label:has([data-intake-filter="search"]) {
    grid-column: span 2;
  }

  #workIntakePanel[data-intake-view="service"] .service-desk-kpis,
  #workIntakePanel[data-intake-view="service"] .service-desk-form,
  #workIntakePanel[data-intake-view="service"] .service-desk-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="service"] .service-desk-ticket {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="service"] .service-desk-ticket-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  #workIntakePanel[data-intake-view="service"] {
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  #workIntakePanel[data-intake-view="service"] .service-desk-head {
    flex-direction: row;
    align-items: center;
  }

  #workIntakePanel[data-intake-view="service"] .work-intake-filters,
  #workIntakePanel[data-intake-view="service"] .service-desk-kpis,
  #workIntakePanel[data-intake-view="service"] .service-desk-form,
  #workIntakePanel[data-intake-view="service"] .service-desk-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="service"] .work-intake-filters label:has([data-intake-filter="search"]) {
    grid-column: 1 / -1;
  }

  #workIntakePanel[data-intake-view="service"] .service-desk-ticket-main > p {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  #workIntakePanel[data-intake-view="service"] .service-desk-head {
    display: grid;
  }

  #workIntakePanel[data-intake-view="service"] .service-desk-head-actions {
    justify-content: flex-start;
  }

  #workIntakePanel[data-intake-view="service"] .work-intake-filters,
  #workIntakePanel[data-intake-view="service"] .service-desk-form,
  #workIntakePanel[data-intake-view="service"] .service-desk-detail-grid {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="service"] .work-intake-filters label:has([data-intake-filter="search"]),
  #workIntakePanel[data-intake-view="service"] .service-desk-form .wide-field,
  #workIntakePanel[data-intake-view="service"] .service-desk-detail-grid .wide-field {
    grid-column: auto;
  }

  #workIntakePanel[data-intake-view="service"] .service-desk-ticket-controls,
  #workIntakePanel[data-intake-view="service"] .service-desk-detail-actions {
    align-items: stretch;
  }
}

@media (max-width: 400px) {
  #workIntakePanel[data-intake-view="service"] .service-desk-kpis {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="service"] .service-desk-head-actions button {
    flex: 1 1 auto;
  }
}

/* Internal Tasks compact workspace */
#workIntakePanel[data-intake-view="tasks"] {
  gap: 10px;
  padding: 13px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-shadow: var(--ui-shadow);
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--ui-border);
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head > div:first-child {
  min-width: 0;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head .eyebrow {
  margin-bottom: 2px;
  color: var(--ui-teal-dark);
  font-size: 9px;
  letter-spacing: 0.055em;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head h2 {
  margin: 0;
  color: var(--ui-text);
  font-size: 18px;
  line-height: 1.15;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head-actions .small-pill {
  min-height: 30px;
  padding: 7px 11px;
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border: 1px solid #bfe4de;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head-actions button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head-actions .primary-button {
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  box-shadow: 0 4px 12px rgba(15, 159, 145, 0.18);
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head-actions .primary-button:hover {
  background: var(--ui-teal-dark);
  border-color: var(--ui-teal-dark);
}

#workIntakePanel[data-intake-view="tasks"] .work-intake-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 7px;
  padding: 9px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="tasks"] .work-intake-filters label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="tasks"] .work-intake-filters label:has([data-intake-filter="search"]) {
  grid-column: span 2;
}

#workIntakePanel[data-intake-view="tasks"] .work-intake-filters label > span,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form label > span,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid label > span {
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

#workIntakePanel[data-intake-view="tasks"] .work-intake-filters input,
#workIntakePanel[data-intake-view="tasks"] .work-intake-filters select,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form input,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form select,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid input,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-border-strong);
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="tasks"] .work-intake-filters input:focus,
#workIntakePanel[data-intake-view="tasks"] .work-intake-filters select:focus,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form input:focus,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form select:focus,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form textarea:focus,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid input:focus,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid select:focus,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid textarea:focus {
  border-color: var(--ui-teal);
  box-shadow: 0 0 0 2px rgba(15, 159, 145, 0.12);
  outline: none;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi {
  position: relative;
  min-width: 0;
  min-height: 63px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 11px 9px 14px;
  overflow: hidden;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ui-teal);
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi span {
  min-width: 0;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi strong {
  color: var(--ui-text);
  font-size: 21px;
  line-height: 1;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi.progress::before {
  background: #3e79bd;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi.progress strong {
  color: #315f9e;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi.overdue::before {
  background: #d54d4d;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi.overdue strong {
  color: #b4232c;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi.today::before {
  background: #d49a24;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi.today strong {
  color: #986500;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi.unassigned::before {
  background: #73869a;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpi.unassigned strong {
  color: #50677d;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--ui-surface-soft);
  border-color: var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form textarea,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  resize: vertical;
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-border-strong);
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form .work-intake-actions {
  align-items: center;
  gap: 7px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form .work-intake-actions button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="tasks"] .work-intake-status {
  margin: -1px 1px 0;
  color: var(--ui-muted);
  font-size: 10px;
}

#workIntakePanel[data-intake-view="tasks"] .work-intake-list {
  gap: 7px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  background: var(--ui-surface);
  border-color: var(--ui-border);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(24, 58, 64, 0.035);
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item.is-overdue {
  border-left: 3px solid #d54d4d;
  background: #fffafa;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item.is-due-today:not(.is-overdue) {
  border-left: 3px solid #d49a24;
  background: #fffdf7;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item.is-expanded {
  align-items: start;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item-main {
  gap: 3px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item-main > strong {
  min-width: 0;
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.2;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item-main > small {
  min-width: 0;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item-main > p {
  min-width: 0;
  max-width: 100%;
  color: #425e64;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-status,
#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-priority {
  min-height: 25px;
  min-width: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-priority {
  color: var(--ui-muted);
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-status.open {
  color: #087c73;
  background: #e7f7f4;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-status.in_progress {
  color: #315f9e;
  background: #e7f0fb;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-status.waiting {
  color: #986500;
  background: #fff4d8;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-status.done {
  color: #257a58;
  background: #e8f7ef;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-status.cancelled {
  color: #76545b;
  background: #f2eaec;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item.is-urgent .tasks-workspace-priority {
  color: #b4232c;
  background: #fff0f1;
  border-color: #f0b8bd;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-action {
  min-height: 29px;
  padding: 6px 10px;
  color: var(--ui-teal-dark);
  border-color: #bcded9;
  border-radius: 7px;
  font-size: 10px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-action:hover {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail {
  grid-column: 1 / -1;
  gap: 9px;
  margin-top: 0;
  padding: 9px;
  background: var(--ui-surface-soft);
  border-color: var(--ui-border);
  border-radius: 9px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-actions {
  justify-content: flex-start;
  gap: 6px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-actions button {
  min-height: 29px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 10px;
}

#workIntakePanel[data-intake-view="tasks"] .service-history,
#workIntakePanel[data-intake-view="tasks"] .service-internal-notes {
  gap: 6px;
}

#workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail > .service-history {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#workIntakePanel[data-intake-view="tasks"] .service-history-row {
  gap: 2px;
  padding: 7px 9px;
  background: var(--ui-surface);
  border-color: var(--ui-border);
  border-radius: 7px;
}

#workIntakePanel[data-intake-view="tasks"] .service-history-row strong,
#workIntakePanel[data-intake-view="tasks"] .service-internal-notes strong {
  color: var(--ui-text);
  font-size: 10px;
}

#workIntakePanel[data-intake-view="tasks"] .service-history-row span,
#workIntakePanel[data-intake-view="tasks"] .service-history-row em,
#workIntakePanel[data-intake-view="tasks"] .service-internal-notes p {
  color: var(--ui-muted);
  font-size: 10px;
}

@media (max-width: 1180px) {
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form,
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  #workIntakePanel[data-intake-view="tasks"] {
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head {
    flex-direction: row;
    align-items: center;
  }

  #workIntakePanel[data-intake-view="tasks"] .work-intake-filters,
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpis,
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form,
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="tasks"] .work-intake-filters label:has([data-intake-filter="search"]) {
    grid-column: 1 / -1;
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item-main > p {
    white-space: normal;
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail > .service-history {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head {
    display: grid;
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head-actions {
    justify-content: flex-start;
  }

  #workIntakePanel[data-intake-view="tasks"] .work-intake-filters,
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form,
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="tasks"] .work-intake-filters label:has([data-intake-filter="search"]),
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-form .wide-field,
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-grid .wide-field {
    grid-column: auto;
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-item-controls,
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-detail-actions {
    align-items: stretch;
  }
}

@media (max-width: 400px) {
  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-kpis {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="tasks"] .tasks-workspace-head-actions button {
    flex: 1 1 auto;
  }
}

/* Partners compact workspace */
#workIntakePanel[data-intake-view="partners"] {
  gap: 10px;
  min-width: 0;
  padding: 13px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-shadow: var(--ui-shadow);
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--ui-border);
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head > div:first-child {
  min-width: 0;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head .eyebrow {
  margin-bottom: 2px;
  color: var(--ui-teal-dark);
  font-size: 9px;
  letter-spacing: 0.055em;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head h2 {
  margin: 0;
  color: var(--ui-text);
  font-size: 18px;
  line-height: 1.15;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head-actions .small-pill {
  min-height: 30px;
  padding: 7px 11px;
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border: 1px solid #bfe4de;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head-actions button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head-actions .primary-button {
  background: var(--ui-teal);
  border-color: var(--ui-teal);
  box-shadow: 0 4px 12px rgba(15, 159, 145, 0.18);
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-head-actions .primary-button:hover {
  background: var(--ui-teal-dark);
  border-color: var(--ui-teal-dark);
}

#workIntakePanel[data-intake-view="partners"] .work-intake-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px));
  align-items: end;
  justify-content: end;
  gap: 7px;
  padding: 9px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="partners"] .work-intake-filters label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="partners"] .work-intake-filters label > span,
#workIntakePanel[data-intake-view="partners"] .partners-workspace-form label > span {
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

#workIntakePanel[data-intake-view="partners"] .work-intake-filters select,
#workIntakePanel[data-intake-view="partners"] .partners-workspace-form input,
#workIntakePanel[data-intake-view="partners"] .partners-workspace-form select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-border-strong);
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="partners"] .work-intake-filters select:focus,
#workIntakePanel[data-intake-view="partners"] .partners-workspace-form input:focus,
#workIntakePanel[data-intake-view="partners"] .partners-workspace-form select:focus,
#workIntakePanel[data-intake-view="partners"] .partners-workspace-form textarea:focus {
  border-color: var(--ui-teal);
  box-shadow: 0 0 0 2px rgba(15, 159, 145, 0.12);
  outline: none;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi {
  position: relative;
  min-width: 0;
  min-height: 63px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 11px 9px 14px;
  overflow: hidden;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ui-teal);
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi span {
  min-width: 0;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi strong {
  color: var(--ui-text);
  font-size: 21px;
  line-height: 1;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi.promoter::before {
  background: #7561bd;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi.promoter strong {
  color: #5e4aa7;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi.distributor::before {
  background: #3e79bd;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi.distributor strong {
  color: #315f9e;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi.dealer::before {
  background: #3f8e74;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi.dealer strong {
  color: #2e745d;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi.attention::before {
  background: #d49a24;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-kpi.attention strong {
  color: #986500;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--ui-surface-soft);
  border-color: var(--ui-border);
  border-radius: 10px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-form label {
  min-width: 0;
  gap: 4px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-form textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  resize: vertical;
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-border-strong);
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-form .work-intake-actions {
  align-items: center;
  gap: 7px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-form .work-intake-actions button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

#workIntakePanel[data-intake-view="partners"] .work-intake-status {
  margin: -1px 1px 0;
  color: var(--ui-muted);
  font-size: 10px;
}

#workIntakePanel[data-intake-view="partners"] .work-intake-list {
  gap: 7px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px;
  background: var(--ui-surface);
  border-color: var(--ui-border);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(24, 58, 64, 0.035);
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item.is-active {
  border-left: 3px solid var(--ui-teal);
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item.is-inactive {
  border-left: 3px solid #8495a2;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item.is-on-hold {
  border-left: 3px solid #d49a24;
  background: #fffdf7;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item.is-expanded {
  align-items: start;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main {
  display: grid;
  grid-template-columns: minmax(145px, 0.8fr) minmax(0, 1.7fr);
  align-items: center;
  gap: 3px 12px;
  min-width: 0;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > strong {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > small:first-of-type {
  grid-column: 1;
  grid-row: 2;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > p {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  color: #425e64;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > small:last-of-type {
  grid-column: 2;
  grid-row: 2;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > small {
  min-width: 0;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-item-controls {
  display: grid;
  grid-template-columns: minmax(92px, 0.9fr) minmax(105px, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-status,
#workIntakePanel[data-intake-view="partners"] .partners-workspace-type {
  width: 100%;
  min-width: 0;
  min-height: 29px;
  padding: 5px 8px;
  color: var(--ui-text);
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  font-size: 10px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-status.active {
  color: #087c73;
  background: #e7f7f4;
  border-color: #bfe4de;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-status.inactive {
  color: #5e7180;
  background: #edf1f4;
  border-color: #d3dde4;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-status.on_hold {
  color: #986500;
  background: #fff4d8;
  border-color: #ead89f;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-type.promoter {
  color: #5e4aa7;
  background: #f1edff;
  border-color: #d9cff8;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-type.distributor {
  color: #315f9e;
  background: #e7f0fb;
  border-color: #c9d9ee;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-type.dealer {
  color: #2e745d;
  background: #e9f5ef;
  border-color: #c8e2d5;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-action {
  min-height: 29px;
  padding: 6px 10px;
  color: var(--ui-teal-dark);
  border-color: #bcded9;
  border-radius: 7px;
  font-size: 10px;
  white-space: nowrap;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-action:hover {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-detail {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 9px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 9px;
}

#workIntakePanel[data-intake-view="partners"] .partners-workspace-detail > .empty-state {
  padding: 10px;
}

#workIntakePanel[data-intake-view="partners"] .partner-linked-projects {
  gap: 7px;
  margin-top: 0;
}

#workIntakePanel[data-intake-view="partners"] .commission-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

#workIntakePanel[data-intake-view="partners"] .commission-summary span {
  padding: 7px 9px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 7px;
}

#workIntakePanel[data-intake-view="partners"] .commission-summary strong {
  font-size: 12px;
}

#workIntakePanel[data-intake-view="partners"] .commission-summary small {
  font-size: 9px;
}

#workIntakePanel[data-intake-view="partners"] .partner-project-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  background: var(--ui-surface);
  border-color: var(--ui-border);
  border-radius: 8px;
}

#workIntakePanel[data-intake-view="partners"] .partner-project-row strong {
  color: var(--ui-text);
  font-size: 11px;
}

#workIntakePanel[data-intake-view="partners"] .partner-project-row span {
  color: var(--ui-muted);
  font-size: 9px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#workIntakePanel[data-intake-view="partners"] .partner-project-row .work-intake-actions {
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

#workIntakePanel[data-intake-view="partners"] .partner-project-row .work-intake-actions button {
  min-height: 27px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 9px;
}

@media (max-width: 1180px) {
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-kpis,
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item-controls {
    grid-template-columns: minmax(110px, 160px) minmax(120px, 170px) auto;
    justify-content: start;
  }
}

@media (max-width: 760px) {
  #workIntakePanel[data-intake-view="partners"] {
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-head {
    flex-direction: row;
    align-items: center;
  }

  #workIntakePanel[data-intake-view="partners"] .work-intake-filters,
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > p {
    white-space: normal;
  }

  #workIntakePanel[data-intake-view="partners"] .commission-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="partners"] .partner-project-row {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="partners"] .partner-project-row .work-intake-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-head {
    display: grid;
    align-items: start;
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-head-actions {
    justify-content: flex-start;
  }

  #workIntakePanel[data-intake-view="partners"] .work-intake-filters,
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-form,
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main,
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item-controls {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-kpis,
  #workIntakePanel[data-intake-view="partners"] .commission-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-form .wide-field {
    grid-column: auto;
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > strong,
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > small:first-of-type,
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > p,
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-item-main > small:last-of-type {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 400px) {
  #workIntakePanel[data-intake-view="partners"] .partners-workspace-kpis,
  #workIntakePanel[data-intake-view="partners"] .commission-summary {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="partners"] .partners-workspace-head-actions button {
    flex: 1 1 auto;
  }
}

/* Access and invitation workspace. Live actions remain fail-closed at the Edge/database boundary. */
#workIntakePanel[data-intake-view="partners"] .partner-invite-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  color: var(--ui-text);
  background: linear-gradient(135deg, #f4fbfa 0%, #ffffff 76%);
  border: 1px solid #bfe4de;
  border-radius: 10px;
}

/* Phase 43 access enrollment and account security */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.os-modal-open {
  overflow: hidden;
}

#authRecoveryRequestPanel {
  display: grid;
  gap: 8px;
}

#authRecoveryRequestPanel.hidden {
  display: none;
}

#accountSecurityModal .os-modal-card,
#accessActionModal .os-modal-card {
  width: min(520px, calc(100vw - 28px));
}

#accessActionModal .access-action-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

#accessActionForm textarea {
  width: 100%;
  resize: vertical;
}

#adminAccessPreviewPanel .admin-access-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

#adminAccessPreviewPanel .admin-access-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#adminAccessPreviewPanel .admin-access-alert {
  margin: 0;
  padding: 8px 10px;
  color: #8a5800;
  background: #fff8e4;
  border: 1px solid #f0d993;
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.45;
}

#adminAccessPreviewPanel .admin-role-matrix-card {
  grid-column: 1 / -1;
}

#adminAccessPreviewPanel details.admin-role-matrix-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
}

#adminAccessPreviewPanel details.admin-role-matrix-card > summary::-webkit-details-marker {
  display: none;
}

#adminAccessPreviewPanel details.admin-role-matrix-card > summary span {
  color: var(--ui-teal-dark);
  font-size: 9px;
  font-weight: 800;
}

#adminAccessPreviewPanel .admin-mock-form input,
#adminAccessPreviewPanel .admin-mock-form select {
  color: var(--ui-text);
  background: var(--ui-surface);
  cursor: text;
}

#adminAccessPreviewPanel .admin-mock-form select {
  cursor: pointer;
}

#adminAccessPreviewPanel .admin-mock-form button {
  opacity: 1;
  cursor: pointer;
}

#adminAccessPreviewPanel .admin-mock-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#adminAccessPreviewPanel .admin-user-enrollment-form {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}

#adminAccessPreviewPanel .admin-form-status {
  grid-column: 1 / -1;
  min-height: 14px;
  margin: 0;
  color: var(--ui-muted);
  font-size: 9px;
}

#adminAccessPreviewPanel .admin-form-status[data-tone="error"],
#accessActionStatus[data-tone="error"] {
  color: #b42318;
}

#adminAccessPreviewPanel .admin-form-status[data-tone="success"],
#accessActionStatus[data-tone="success"] {
  color: #087c73;
}

#adminAccessPreviewPanel .admin-access-search,
#adminAccessPreviewPanel .admin-invitation-filter {
  min-width: 170px;
}

#adminAccessPreviewPanel .admin-access-search input,
#adminAccessPreviewPanel .admin-invitation-filter select {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--ui-text);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  font-size: 10px;
}

#adminAccessPreviewPanel .admin-access-directory,
#adminAccessPreviewPanel .admin-invitation-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
}

#adminAccessPreviewPanel .admin-directory-row,
#adminAccessPreviewPanel .admin-invitation-row {
  display: grid;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

#adminAccessPreviewPanel .admin-directory-row {
  grid-template-columns: minmax(150px, 1fr) auto auto auto;
}

#adminAccessPreviewPanel .admin-invitation-row {
  grid-template-columns: minmax(155px, 1fr) auto auto auto;
}

#adminAccessPreviewPanel .admin-directory-identity,
#adminAccessPreviewPanel .admin-invitation-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#adminAccessPreviewPanel .admin-directory-identity strong,
#adminAccessPreviewPanel .admin-invitation-row strong {
  color: var(--ui-text);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#adminAccessPreviewPanel .admin-directory-identity span,
#adminAccessPreviewPanel .admin-invitation-row span,
#adminAccessPreviewPanel .admin-invitation-row small {
  color: var(--ui-muted);
  font-size: 8px;
  overflow-wrap: anywhere;
}

#adminAccessPreviewPanel .admin-directory-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

#adminAccessPreviewPanel .admin-user-status.is-inactive {
  color: #9c2d24;
  background: #fff0ef;
  border-color: #f3c2be;
}

#adminAccessPreviewPanel .admin-invitation-status {
  display: inline-flex;
  justify-content: center;
  padding: 4px 7px;
  color: #536a70;
  background: #edf3f3;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

#adminAccessPreviewPanel .admin-invitation-status.is-sent,
#adminAccessPreviewPanel .admin-invitation-status.is-accepted {
  color: #087c73;
  background: var(--ui-teal-soft);
  border-color: #bfe4de;
}

#adminAccessPreviewPanel .admin-invitation-status.is-failed,
#adminAccessPreviewPanel .admin-invitation-status.is-review_required {
  color: #a33a31;
  background: #fff0ef;
  border-color: #f3c2be;
}

#adminAccessPreviewPanel .admin-invitation-status.is-prepared {
  color: #8a5800;
  background: #fff8e4;
  border-color: #f0d993;
}

#adminAccessPreviewPanel .admin-access-empty {
  padding: 18px 10px;
  color: var(--ui-muted);
  background: var(--ui-surface-soft);
  border: 1px dashed var(--ui-border);
  border-radius: 8px;
  font-size: 9px;
  text-align: center;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid select:not(:disabled) {
  color: var(--ui-text);
  background: var(--ui-surface);
  cursor: pointer;
}

@media (max-width: 1280px) {
  #adminAccessPreviewPanel .admin-access-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #adminAccessPreviewPanel .admin-user-enrollment-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #adminAccessPreviewPanel .admin-user-enrollment-form button {
    width: 100%;
  }
}

@media (max-width: 900px) {
  #adminAccessPreviewPanel .admin-directory-row,
  #adminAccessPreviewPanel .admin-invitation-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #adminAccessPreviewPanel .admin-directory-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  #adminAccessPreviewPanel .admin-access-head-actions {
    justify-content: flex-start;
  }

  #adminAccessPreviewPanel .admin-access-summary,
  #adminAccessPreviewPanel .admin-user-enrollment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #adminAccessPreviewPanel .admin-access-summary,
  #adminAccessPreviewPanel .admin-user-enrollment-form,
  #adminAccessPreviewPanel .admin-directory-row,
  #adminAccessPreviewPanel .admin-invitation-row {
    grid-template-columns: 1fr;
  }

  #adminAccessPreviewPanel .admin-access-search,
  #adminAccessPreviewPanel .admin-invitation-filter {
    width: 100%;
    min-width: 0;
  }
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-head span {
  color: var(--ui-teal-dark);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-head strong {
  color: var(--ui-text);
  font-size: 12px;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border: 1px solid #bfe4de;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid {
  display: grid;
  grid-template-columns: minmax(230px, 1.3fr) minmax(210px, 1fr) auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid label {
  min-width: 0;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid input:disabled,
#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid select:disabled {
  opacity: 1;
  color: #60777c;
  background: #f3f7f7;
  cursor: not-allowed;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid button:disabled {
  min-height: 32px;
  opacity: 0.62;
  cursor: not-allowed;
}

#workIntakePanel[data-intake-view="partners"] .partner-invite-preview > p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 9px;
  line-height: 1.4;
}

#adminAccessPreviewPanel {
  min-width: 0;
  padding: 13px;
  color: var(--ui-text);
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-shadow: var(--ui-shadow);
}

#adminAccessPreviewPanel .admin-access-workspace {
  display: grid;
  gap: 10px;
  min-width: 0;
}

#adminAccessPreviewPanel .admin-access-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ui-border);
}

#adminAccessPreviewPanel .admin-access-head > div {
  min-width: 0;
}

#adminAccessPreviewPanel .admin-access-head h2 {
  margin: 2px 0 3px;
  color: var(--ui-text);
  font-size: 18px;
}

#adminAccessPreviewPanel .admin-access-head > div > p:last-child {
  margin: 0;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.4;
}

#adminAccessPreviewPanel .admin-preview-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--ui-teal-dark);
  background: var(--ui-teal-soft);
  border: 1px solid #bfe4de;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

#adminAccessPreviewPanel .admin-preview-pill.subtle {
  color: #61777c;
  background: #f2f6f6;
  border-color: var(--ui-border);
}

#adminAccessPreviewPanel .admin-access-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

#adminAccessPreviewPanel .admin-access-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 9px;
}

#adminAccessPreviewPanel .admin-access-metric span {
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#adminAccessPreviewPanel .admin-access-metric strong {
  min-width: 0;
  color: var(--ui-text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#adminAccessPreviewPanel .admin-access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}

#adminAccessPreviewPanel .admin-access-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(24, 58, 64, 0.035);
}

#adminAccessPreviewPanel .admin-access-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

#adminAccessPreviewPanel .admin-access-card-head > div {
  min-width: 0;
}

#adminAccessPreviewPanel .admin-access-card-head > div > span {
  color: var(--ui-teal-dark);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#adminAccessPreviewPanel .admin-access-card-head h3 {
  margin: 2px 0 0;
  color: var(--ui-text);
  font-size: 13px;
}

#adminAccessPreviewPanel .admin-role-matrix {
  display: grid;
  min-width: 0;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  overflow: hidden;
}

#adminAccessPreviewPanel .admin-role-matrix-head,
#adminAccessPreviewPanel .admin-role-matrix-row {
  display: grid;
  grid-template-columns: minmax(125px, 0.9fr) minmax(0, 2.4fr);
  min-width: 0;
}

#adminAccessPreviewPanel .admin-role-matrix-head {
  align-items: center;
  color: #49646a;
  background: #f2f7f7;
  border-bottom: 1px solid var(--ui-border);
  font-size: 8px;
  text-transform: uppercase;
}

#adminAccessPreviewPanel .admin-role-matrix-head > strong {
  padding: 7px 8px;
}

#adminAccessPreviewPanel .admin-role-capability-head,
#adminAccessPreviewPanel .admin-role-permissions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
}

#adminAccessPreviewPanel .admin-role-capability-head span {
  padding: 7px 5px;
  border-left: 1px solid var(--ui-border);
  text-align: center;
}

#adminAccessPreviewPanel .admin-role-matrix-row {
  align-items: stretch;
  border-bottom: 1px solid var(--ui-border);
}

#adminAccessPreviewPanel .admin-role-matrix-row:last-child {
  border-bottom: 0;
}

#adminAccessPreviewPanel .admin-role-name {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 0;
  padding: 7px 8px;
}

#adminAccessPreviewPanel .admin-role-name strong {
  color: var(--ui-text);
  font-size: 10px;
}

#adminAccessPreviewPanel .admin-role-name span {
  color: var(--ui-muted);
  font-size: 8px;
  overflow-wrap: anywhere;
}

#adminAccessPreviewPanel .admin-access-state {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  min-width: 0;
  padding: 6px 4px;
  border-left: 1px solid var(--ui-border);
  text-align: center;
}

#adminAccessPreviewPanel .admin-access-state small {
  display: none;
  color: var(--ui-muted);
  font-size: 7px;
}

#adminAccessPreviewPanel .admin-access-state strong {
  font-size: 8px;
}

#adminAccessPreviewPanel .admin-access-state.is-allowed {
  color: #087c73;
  background: #f0faf8;
}

#adminAccessPreviewPanel .admin-access-state.is-conditional {
  color: #93620a;
  background: #fff9e9;
}

#adminAccessPreviewPanel .admin-access-state.is-blocked {
  color: #6f7e84;
  background: #f7f9f9;
}

#adminAccessPreviewPanel .admin-mock-form {
  display: grid;
  gap: 7px;
  min-width: 0;
}

#adminAccessPreviewPanel .admin-mock-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#adminAccessPreviewPanel .admin-mock-form label > span {
  color: var(--ui-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#adminAccessPreviewPanel .admin-mock-form input,
#adminAccessPreviewPanel .admin-mock-form select {
  width: 100%;
  min-width: 0;
  min-height: 31px;
  padding: 6px 8px;
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  font-size: 10px;
}

#adminAccessPreviewPanel .admin-mock-form button {
  min-height: 31px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 10px;
}

#adminAccessPreviewPanel .admin-security-profile {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

#adminAccessPreviewPanel .admin-security-profile strong {
  color: var(--ui-text);
  font-size: 11px;
}

#adminAccessPreviewPanel .admin-security-profile span,
#adminAccessPreviewPanel .admin-security-profile small {
  color: var(--ui-muted);
  font-size: 8px;
  overflow-wrap: anywhere;
}

#adminAccessPreviewPanel .admin-security-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#adminAccessPreviewPanel .admin-security-form button {
  width: 100%;
}

#adminAccessPreviewPanel .admin-users-card {
  grid-column: 1 / -1;
}

#adminAccessPreviewPanel .admin-user-enrollment-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

#adminAccessPreviewPanel .admin-current-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

#adminAccessPreviewPanel .admin-current-profile > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

#adminAccessPreviewPanel .admin-current-profile > div > span,
#adminAccessPreviewPanel .admin-current-profile small {
  color: var(--ui-muted);
  font-size: 8px;
  overflow-wrap: anywhere;
}

#adminAccessPreviewPanel .admin-current-profile strong {
  color: var(--ui-text);
  font-size: 10px;
}

#adminAccessPreviewPanel .admin-user-role,
#adminAccessPreviewPanel .admin-user-status {
  padding: 4px 7px;
  color: #49646a;
  background: #edf3f3;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

#adminAccessPreviewPanel .admin-user-status {
  color: #087c73;
  background: var(--ui-teal-soft);
  border-color: #bfe4de;
}

#adminAccessPreviewPanel .admin-mock-note {
  margin: 0;
  color: var(--ui-muted);
  font-size: 8px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  #adminAccessPreviewPanel .admin-access-grid {
    grid-template-columns: 1fr;
  }

  #adminAccessPreviewPanel .admin-users-card {
    grid-column: auto;
  }

  #adminAccessPreviewPanel .admin-user-enrollment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #adminAccessPreviewPanel .admin-access-head {
    align-items: flex-start;
  }

  #adminAccessPreviewPanel .admin-access-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #adminAccessPreviewPanel .admin-role-matrix-head {
    display: none;
  }

  #adminAccessPreviewPanel .admin-role-matrix-row {
    grid-template-columns: 1fr;
  }

  #adminAccessPreviewPanel .admin-role-name {
    border-bottom: 1px solid var(--ui-border);
  }

  #adminAccessPreviewPanel .admin-access-state {
    border-left: 0;
    border-right: 1px solid var(--ui-border);
  }

  #adminAccessPreviewPanel .admin-access-state:last-child {
    border-right: 0;
  }

  #adminAccessPreviewPanel .admin-access-state small {
    display: block;
  }
}

@media (max-width: 520px) {
  #workIntakePanel[data-intake-view="partners"] .partner-invite-preview-head {
    align-items: flex-start;
  }

  #workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid,
  #adminAccessPreviewPanel .admin-access-summary,
  #adminAccessPreviewPanel .admin-security-form,
  #adminAccessPreviewPanel .admin-user-enrollment-form,
  #adminAccessPreviewPanel .admin-current-profile {
    grid-template-columns: 1fr;
  }

  #workIntakePanel[data-intake-view="partners"] .partner-invite-preview-grid button {
    grid-column: auto;
  }

  #adminAccessPreviewPanel .admin-access-head,
  #adminAccessPreviewPanel .admin-access-card-head {
    display: grid;
    justify-items: start;
  }

  #adminAccessPreviewPanel .admin-preview-pill {
    white-space: normal;
  }

  #adminAccessPreviewPanel .admin-role-permissions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #adminAccessPreviewPanel .admin-access-state:nth-child(2) {
    border-right: 0;
  }

  #adminAccessPreviewPanel .admin-access-state:nth-child(n + 3) {
    border-top: 1px solid var(--ui-border);
  }

  #adminAccessPreviewPanel .admin-user-role,
  #adminAccessPreviewPanel .admin-user-status {
    width: fit-content;
  }
}
