:root {
  --jsa-midnight: #020611;
  --jsa-navy: #061a33;
  --jsa-ink: #121826;
  --jsa-signal-blue: #0b4db8;
  --jsa-sky: #78bfff;
  --jsa-cobalt: #4057ff;
  --jsa-teal: #08afcb;
  --jsa-mist: #d8e7f7;
  --jsa-white: #ffffff;
  --jsa-gray: #a7b0bf;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --surface-blue: #edf6ff;
  --border: #dce7f3;
  --border-strong: #c5d7eb;
  --text: #121826;
  --muted: #637083;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #13795b;
  --warning: #9a6700;
  --shadow: 0 18px 50px rgba(6, 26, 51, 0.08);
  --shadow-strong: 0 22px 70px rgba(6, 26, 51, 0.12);
  --font-display: "Urbanist", "Poppins", Arial, sans-serif;
  --font-body: "Poppins", Arial, sans-serif;
  --font-accent: "Raleway", "Poppins", Arial, sans-serif;
  color: var(--text);
  font-family: var(--font-body);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 75% -10%, rgba(120, 191, 255, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(216, 231, 247, 0.78), rgba(255, 255, 255, 0.9) 42%),
    var(--surface-soft);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

.screen {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  background:
    radial-gradient(circle at 40% 0%, rgba(120, 191, 255, 0.16), transparent 38%),
    var(--jsa-navy);
  color: var(--jsa-white);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 34px;
}

.brand img {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(120, 191, 255, 0.32);
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--jsa-mist);
  font-size: 0.76rem;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.nav-button:hover,
.nav-button.is-active {
  border-color: rgba(120, 191, 255, 0.34);
  background: rgba(120, 191, 255, 0.13);
  color: var(--jsa-white);
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar,
.content-stack,
.client-workspace,
.preview-banner {
  width: min(100%, 1480px);
  margin-right: auto;
  margin-left: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  margin-bottom: 18px;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 2.4vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
}

.page-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(6, 26, 51, 0.05);
}

.user-email {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-stack {
  display: grid;
  gap: 18px;
}

.preview-banner {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-blue);
  color: var(--jsa-navy);
  font-weight: 700;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  min-height: 210px;
  padding: 32px;
  overflow: hidden;
  border-color: rgba(120, 191, 255, 0.32);
  background:
    radial-gradient(circle at 88% 16%, rgba(120, 191, 255, 0.3), transparent 26%),
    linear-gradient(135deg, rgba(2, 6, 17, 0.98), rgba(6, 26, 51, 0.98) 52%, rgba(11, 77, 184, 0.9)),
    var(--jsa-navy);
  color: var(--jsa-white);
  box-shadow: var(--shadow-strong);
}

.dashboard-hero .section-label {
  color: var(--jsa-sky);
}

.dashboard-hero h2 {
  max-width: 620px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
}

.dashboard-hero p:not(.section-label) {
  max-width: 660px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.65;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
}

.dashboard-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 22px 24px 20px;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.dashboard-stat:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-strong);
  transform: translateY(-1px);
}

.dashboard-stat .metric-label,
.dashboard-stat .metric-value,
.dashboard-stat .metric-note {
  display: block;
}

.dashboard-stat-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--jsa-white), var(--surface-blue));
  color: var(--jsa-signal-blue);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.dashboard-stat .tile-icon {
  position: absolute;
  top: 22px;
  right: 22px;
  margin-top: 0;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.dashboard-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header-compact {
  min-height: 78px;
}

.surface {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.surface.dashboard-hero {
  border-color: rgba(120, 191, 255, 0.32);
  background:
    radial-gradient(circle at 88% 16%, rgba(120, 191, 255, 0.3), transparent 26%),
    linear-gradient(135deg, rgba(2, 6, 17, 0.98), rgba(6, 26, 51, 0.98) 52%, rgba(11, 77, 184, 0.9)),
    var(--jsa-navy);
  color: var(--jsa-white);
}

.dashboard-stat .metric-value {
  margin-top: 10px;
  color: var(--jsa-navy);
  font-size: 3.15rem;
  line-height: 0.92;
}

.dashboard-stat .metric-note {
  max-width: 100%;
  margin-top: 14px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.dashboard-stat .metric-label {
  padding-right: 54px;
}

.hero-panel {
  min-height: 280px;
  padding: clamp(22px, 4vw, 42px);
  background:
    linear-gradient(135deg, rgba(6, 26, 51, 0.97), rgba(11, 77, 184, 0.92)),
    var(--jsa-navy);
  color: var(--jsa-white);
  overflow: hidden;
}

.hero-panel h2 {
  max-width: 620px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4.25rem);
  font-weight: 800;
  line-height: 0.98;
}

.hero-panel p {
  max-width: 620px;
  margin: 18px 0 28px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1.7;
}

.metric-panel {
  display: grid;
  align-content: space-between;
  min-height: 280px;
  padding: 28px;
}

.metric-label,
.section-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--font-accent);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-value {
  margin: 0;
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: clamp(4rem, 9vw, 7rem);
  font-weight: 800;
  line-height: 0.86;
}

.metric-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.status-overview {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.status-row {
  display: grid;
  grid-template-columns: 92px 74px minmax(96px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.status-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-blue);
}

.status-count {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.status-row .status-pill {
  justify-content: center;
  width: 84px;
  min-height: 30px;
  padding: 0 8px;
}

.status-meter {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f1fb;
}

.status-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jsa-signal-blue), var(--jsa-sky));
}

.quick-summary {
  margin: 0 18px 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.quick-summary p:last-child {
  margin: 0;
  color: var(--jsa-navy);
  font-weight: 800;
}

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
}

.client-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.62fr);
  gap: 18px;
  align-items: start;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px auto;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.freelancer-toolbar {
  grid-template-columns: minmax(180px, 1fr) auto auto;
}

.projects-toolbar {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
}

.projects-toolbar .btn {
  justify-self: end;
  white-space: nowrap;
}

.project-filter-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.project-filter-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-filter-select {
  flex: 0 1 230px;
  max-width: min(100%, 250px);
  min-width: 0;
}

.projects-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.66fr);
}

.project-detail-panel {
  overflow: visible;
}

.client-project-intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-soft), var(--surface));
}

.project-scope-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.project-scope-card span {
  color: var(--muted);
  font-weight: 700;
}

.project-scope-card strong {
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
}

.project-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-section-title.compact {
  align-items: center;
}

.selection-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--jsa-signal-blue);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.team-card,
.participant-option,
.selected-participant-card,
.freelancer-result,
.attachment-row,
.approval-row,
.project-mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.team-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.team-card strong,
.participant-option strong,
.selected-participant-card strong,
.freelancer-result strong,
.attachment-row strong,
.approval-row strong,
.project-mini-row strong {
  display: block;
  color: var(--jsa-navy);
  font-weight: 800;
}

.team-card small,
.participant-option small,
.selected-participant-card small,
.freelancer-result small,
.attachment-row small,
.approval-row small,
.project-mini-row small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.participant-picker {
  display: grid;
  gap: 10px;
}

.participant-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}

.participant-list-tall {
  max-height: 340px;
}

.selected-participant-list,
.freelancer-search-results {
  display: grid;
  gap: 8px;
}

.participant-option {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.selected-participant-card,
.freelancer-result {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.freelancer-result {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.selected-participant-card {
  background: var(--surface-soft);
}

.selected-participant-card .icon-btn,
.freelancer-result > .icon {
  margin-left: auto;
}

.freelancer-search-wrap {
  margin-top: 2px;
}

.participant-option:hover,
.freelancer-result:hover {
  border-color: var(--border-strong);
  background: var(--surface-blue);
}

.freelancer-result.is-unavailable,
.freelancer-result.is-unavailable:hover {
  border-color: var(--border);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.freelancer-result.is-unavailable strong,
.freelancer-result.is-unavailable small {
  color: var(--muted);
}

.participant-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.contact-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}

.contact-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-thumb-large {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  font-size: 0.95rem;
}

.attachment-panel {
  display: grid;
  gap: 12px;
}

.attachment-dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 126px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--jsa-navy);
  text-align: center;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.attachment-dropzone:hover,
.attachment-dropzone.is-dragging {
  border-color: var(--jsa-signal-blue);
  background: var(--surface-blue);
  box-shadow: 0 0 0 3px rgba(120, 191, 255, 0.22);
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.attachment-row.is-pending {
  background: var(--surface-blue);
}

.attachment-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--jsa-signal-blue);
}

.attachment-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.approval-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface-soft), var(--surface));
}

.approval-panel h3 {
  margin: 0;
  color: var(--jsa-navy);
  font-family: var(--font-display);
}

.approval-list {
  display: grid;
  gap: 8px;
}

.approval-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.approval-state {
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.approval-state.is-approved {
  border-color: rgba(19, 121, 91, 0.28);
  background: #e7f8ef;
  color: #13795b;
}

.project-actions {
  display: grid;
  gap: 12px;
  justify-content: stretch;
}

.single-panel:has([data-project-form]) {
  overflow: visible;
}

.project-actions .action-group {
  align-items: center;
}

.project-action-primary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-save-actions {
  flex: 1 1 auto;
}

.project-delete-action {
  flex: 0 0 auto;
}

.project-approval-row {
  display: grid;
  justify-items: start;
  width: 100%;
  padding-top: 2px;
}

.project-send-approval {
  width: min(100%, 360px);
  min-height: 46px;
  border-color: rgba(11, 77, 184, 0.28);
  background: var(--surface-blue);
}

.project-send-approval:hover {
  border-color: var(--border-strong);
  background: #edf6ff;
}

.project-mini-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.project-mini-row {
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

.project-mini-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-blue);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  color: var(--jsa-navy);
  font-weight: 800;
}

.readonly-account-section {
  gap: 10px;
}

.readonly-block {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.readonly-block p {
  margin: 0;
  color: var(--jsa-navy);
  line-height: 1.45;
}

.readonly-contact-list {
  display: grid;
  gap: 8px;
}

.readonly-contact-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.readonly-contact-row strong,
.readonly-contact-row small {
  display: block;
}

.readonly-contact-row strong {
  color: var(--jsa-navy);
  font-weight: 800;
}

.readonly-contact-row small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.settings-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 680px;
  overflow: hidden;
}

.settings-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-soft), var(--surface));
}

.settings-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.settings-tab strong {
  color: var(--jsa-navy);
}

.settings-tab:hover,
.settings-tab.is-active {
  border-color: var(--border-strong);
  background: var(--surface-blue);
  color: var(--jsa-navy);
}

.settings-main {
  min-width: 0;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-header .field-note {
  max-width: 680px;
  margin: 8px 0 0;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.settings-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.settings-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.settings-error {
  margin: 0;
  padding: 14px 20px 0;
}

.settings-table-wrap {
  max-height: 62vh;
  overflow: auto;
}

.single-panel {
  width: min(100%, 980px);
  margin-right: auto;
  margin-left: auto;
  overflow: hidden;
}

.settings-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
}

.settings-table th,
.settings-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.settings-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-accent);
  font-size: 0.7rem;
  text-align: left;
  text-transform: uppercase;
}

.grid-field {
  width: 100%;
  min-width: 120px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}

.grid-field:focus {
  border-color: var(--jsa-signal-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(120, 191, 255, 0.28);
}

.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
}

.input-wrap input {
  padding-left: 40px;
}

.field,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.textarea {
  min-height: 86px;
  resize: vertical;
}

.textarea.large {
  min-height: 180px;
}

.field:focus,
.select:focus,
.textarea:focus {
  border-color: var(--jsa-signal-blue);
  box-shadow: 0 0 0 3px rgba(120, 191, 255, 0.34);
}

.select.project-filter-select {
  padding-right: 38px;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%235F6F86' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-size: 18px 18px;
  background-repeat: no-repeat;
}

.field[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.label-text {
  display: block;
  margin-bottom: 7px;
  color: var(--jsa-navy);
  font-size: 0.78rem;
  font-weight: 700;
}

.full-button {
  width: 100%;
}

.auth-form {
  display: grid;
  gap: 12px;
  width: 100%;
  margin-top: 18px;
}

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

.notice-panel {
  display: grid;
  gap: 14px;
  width: 100%;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: left;
}

.notice-panel p {
  margin: 0;
}

.portal-admin-transfer-alert {
  margin: 0 0 14px;
  border-color: #f0d58c;
  background: #fff9e8;
}

.portal-admin-transfer-alert strong {
  color: var(--jsa-navy);
}

.portal-auth {
  padding: 28px 16px;
}

.portal-card {
  width: min(100%, 980px);
}

.client-invite-card {
  width: min(100%, 680px);
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.client-invite-hero {
  padding: clamp(32px, 6vw, 56px) clamp(28px, 6vw, 64px) 24px;
}

.client-invite-hero .auth-logo {
  margin-bottom: 22px;
}

.client-invite-hero .section-label {
  margin: 0 0 18px;
}

.client-invite-hero h1 {
  max-width: 520px;
}

.client-invite-card .client-invite-message {
  max-width: 540px;
  margin: 22px 0 0;
  font-size: 1rem;
}

.client-invite-message strong,
.client-invite-panel-copy strong {
  color: var(--jsa-navy);
  font-weight: 800;
}

.client-invite-panel {
  padding: 0 clamp(24px, 6vw, 64px) clamp(30px, 6vw, 56px);
}

.client-invite-auth-panel {
  padding: clamp(20px, 4vw, 26px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(237, 246, 255, 0.86), rgba(255, 255, 255, 0.98) 42%),
    var(--surface);
  box-shadow: 0 18px 44px rgba(6, 26, 51, 0.07);
}

.client-invite-panel-header {
  margin-bottom: 18px;
}

.client-invite-panel-header .section-label {
  margin: 0 0 8px;
}

.client-invite-panel-header h2 {
  margin: 0;
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  line-height: 1.05;
}

.client-invite-form {
  margin-top: 0;
}

.client-invite-card .client-invite-panel-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.client-invite-error-wrap {
  padding-top: 0;
}

.client-invite-error-wrap .error-note {
  margin: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  flex: 0 0 auto;
}

.portal-profile-shell {
  width: 100%;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
}

.portal-profile-shell .panel-header {
  background: var(--surface-soft);
}

.portal-profile-panel .panel-header {
  background: var(--surface-soft);
}

.freelancer-hero {
  min-height: 190px;
}

.portal-metric-value {
  display: block;
  margin-top: 12px;
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
}

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

.availability-choice {
  display: block;
  min-width: 0;
}

.availability-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.availability-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--jsa-navy);
  font-weight: 800;
}

.availability-choice input:checked + span {
  border-color: var(--jsa-signal-blue);
  box-shadow: 0 0 0 3px rgba(120, 191, 255, 0.24);
}

.availability-choice[data-availability="green"] input:checked + span {
  background: #e7f8ef;
  color: #13795b;
}

.availability-choice[data-availability="yellow"] input:checked + span {
  background: #fff7dd;
  color: #9a6700;
}

.availability-choice[data-availability="red"] input:checked + span {
  background: #fff1f0;
  color: #b42318;
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.availability-pill[data-availability="green"] {
  background: #e7f8ef;
  color: #13795b;
}

.availability-pill[data-availability="yellow"] {
  background: #fff7dd;
  color: #9a6700;
}

.availability-pill[data-availability="red"] {
  background: #fff1f0;
  color: #b42318;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 17, 0.54);
}

.modal {
  width: min(100%, 520px);
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--jsa-signal-blue);
  color: var(--jsa-white);
}

.btn-primary:hover {
  background: #093f98;
}

.btn-light {
  border-color: rgba(120, 191, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: var(--jsa-white);
}

.btn-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--jsa-navy);
}

.btn-secondary:hover {
  background: var(--surface-blue);
}

.btn-danger {
  border-color: #f2b8b5;
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--jsa-navy);
}

.icon-btn:hover {
  background: var(--surface-blue);
}

.danger-icon {
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

.client-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
}

.client-table th,
.client-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.client-table th {
  color: var(--muted);
  font-family: var(--font-accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-table-compact th:last-child,
.project-table-compact td:last-child {
  width: 170px;
  text-align: right;
}

.client-row {
  background: var(--surface);
  cursor: pointer;
}

.client-row:hover,
.client-row.is-selected {
  background: #f4f9ff;
}

.client-row.is-selected {
  box-shadow: inset 4px 0 0 var(--jsa-signal-blue);
}

.client-row:focus-visible {
  outline: 3px solid rgba(120, 191, 255, 0.56);
  outline-offset: -3px;
}

.company-name {
  margin: 0;
  color: var(--jsa-navy);
  font-weight: 800;
}

.profile-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.avatar-thumb {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--jsa-signal-blue);
  font-size: 0.78rem;
  font-weight: 800;
  object-fit: cover;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--jsa-signal-blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill[data-status="Active"] {
  background: #ecfdf5;
  color: var(--success);
}

.status-pill[data-status="Invited"] {
  background: #ecfdf5;
  color: var(--success);
}

.status-pill[data-status="Sending"] {
  background: #f1f5f9;
  color: #475569;
}

.status-pill[data-status="Paused"] {
  background: #fff8e7;
  color: #9a6700;
}

.status-pill[data-status="Former"] {
  background: #f1f5f9;
  color: #475569;
}

.status-pill[data-status="Draft"] {
  background: #f8fafc;
  color: #475569;
}

.status-pill[data-status="Pending Approval"] {
  background: #fff8e7;
  color: #9a6700;
}

.status-pill[data-status="Approved"] {
  background: #ecfdf5;
  color: var(--success);
}

.status-pill[data-status="Complete"] {
  background: #eff6ff;
  color: var(--jsa-signal-blue);
}

.status-pill[data-status="Canceled"] {
  background: #fff1f0;
  color: var(--danger);
}

.empty-state {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state-action {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 150px;
}

.empty-state-action p {
  max-width: 380px;
  margin: 0;
  line-height: 1.6;
}

.empty-title {
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.form-panel {
  position: sticky;
  top: 22px;
}

.form-body {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.form-section {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.profile-uploader {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--jsa-signal-blue);
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  object-fit: cover;
}

.expertise-layout {
  display: grid;
  gap: 14px;
}

.expertise-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.expertise-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.expertise-panel h3 {
  margin: 0;
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.selected-expertise {
  min-height: 30px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--jsa-navy);
  font-size: 0.74rem;
  font-weight: 700;
}

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

.compact-note {
  margin: 0;
  font-size: 0.82rem;
}

.expertise-browser {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.expertise-category {
  display: grid;
  gap: 8px;
}

.expertise-category > p {
  margin: 8px 0 0;
  color: var(--jsa-navy);
  font-family: var(--font-accent);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.expertise-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.expertise-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--jsa-navy);
  font-weight: 800;
  cursor: pointer;
}

.expertise-group summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.expertise-options {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.expertise-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px;
  border-radius: 7px;
  color: var(--text);
}

.expertise-option:hover {
  background: var(--surface-blue);
}

.expertise-option input {
  margin-top: 3px;
}

.expertise-option strong,
.expertise-option small {
  display: block;
}

.expertise-option strong {
  color: var(--jsa-navy);
  font-size: 0.84rem;
}

.expertise-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.expertise-option.is-parent {
  margin: 0 10px 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

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

.field-note {
  flex: 1 0 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

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

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

.field-group {
  display: grid;
  gap: 7px;
}

.field-group.full {
  grid-column: 1 / -1;
}

.field-group label,
.checkbox-label {
  color: var(--jsa-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.required {
  color: var(--jsa-signal-blue);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.contact-item {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.contact-item:first-of-type {
  border-top: 0;
}

.contact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contact-section-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.contact-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.contact-portal-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.contact-portal-copy {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.contact-portal-copy .field-note {
  margin: 0;
}

.contact-portal-panel .btn {
  flex: 0 0 auto;
}

.contact-portal-panel .btn:disabled {
  opacity: 0.58;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid rgba(120, 191, 255, 0.34);
  border-radius: 8px;
  background: var(--jsa-navy);
  color: var(--jsa-white);
  box-shadow: 0 18px 48px rgba(2, 6, 17, 0.22);
}

.auth-screen,
.setup-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 520px);
  padding: clamp(24px, 5vw, 42px);
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.auth-card h1 {
  margin: 0;
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 800;
  line-height: 0.94;
}

.auth-card p {
  margin: 18px 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.setup-list {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.error-note {
  margin-top: 14px;
  color: var(--danger);
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.input-icon {
  width: 18px;
  height: 18px;
}

@media (max-width: 1040px) {
  .screen {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 12px;
  }

  .brand {
    justify-content: center;
  }

  .brand div,
  .nav-button span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .nav-button {
    justify-content: center;
    padding: 0;
  }

  .dashboard-hero,
  .dashboard-columns,
  .client-workspace,
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .projects-toolbar {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .settings-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .form-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .screen {
    display: block;
  }

  .sidebar {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 12px 14px;
  }

  .brand {
    margin: 0;
  }

  .nav {
    display: flex;
  }

  .nav-footer {
    display: flex;
    margin-top: 0;
    padding-top: 0;
  }

  .nav-button {
    width: 44px;
  }

  .main {
    padding: 16px;
  }

  .auth-screen.portal-auth {
    align-items: start;
    padding: 16px;
  }

  .client-invite-hero {
    padding: 28px 24px 20px;
  }

  .client-invite-hero h1 {
    font-size: clamp(3rem, 15vw, 4.1rem);
  }

  .client-invite-panel {
    padding: 0 20px 24px;
  }

  .client-invite-auth-panel {
    padding: 20px;
  }

  .client-invite-card .split-actions {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-box {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .projects-toolbar,
  .client-project-intro,
  .detail-list div {
    grid-template-columns: 1fr;
  }

  .projects-toolbar .btn {
    justify-self: stretch;
    width: 100%;
  }

  .project-filter-strip {
    align-items: stretch;
  }

  .project-filter-label {
    flex-basis: 100%;
  }

  .project-filter-select {
    flex-basis: min(100%, 300px);
    max-width: min(100%, 300px);
  }

  .readonly-contact-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .readonly-contact-row .status-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .contact-portal-panel,
  .project-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .project-action-primary-row,
  .project-save-actions,
  .project-approval-row {
    display: grid;
    justify-items: stretch;
    width: 100%;
  }

  .project-send-approval,
  .project-delete-action {
    width: 100%;
  }

  .participant-list,
  .participant-list-tall {
    max-height: 280px;
  }

  .settings-header,
  .settings-actions {
    display: grid;
    justify-content: stretch;
  }

  .settings-tools {
    grid-template-columns: 1fr;
  }

  .settings-count {
    text-align: left;
  }

  .settings-table-wrap {
    max-height: 58vh;
  }

  .dashboard-hero {
    min-height: auto;
    padding: 24px;
  }

  .dashboard-hero h2 {
    font-size: 2.2rem;
  }

  .dashboard-actions {
    justify-content: stretch;
  }

  .dashboard-actions .btn {
    flex: 1 1 180px;
  }

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

  .dashboard-stat {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .status-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }

  .status-row .status-pill {
    justify-content: center;
  }

  .profile-uploader {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero-panel {
    min-height: auto;
  }

  .client-table {
    min-width: 560px;
  }

  .project-table-compact {
    min-width: 420px;
  }
}
