:root {
  --ink: #172536;
  --ink-2: #33475d;
  --muted: #596b80;
  --muted-2: #6e7f91;
  --line: #d8e1e9;
  --line-strong: #c4d1dc;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --surface-blue: #edf5fb;
  --surface-green: #edf8f4;
  --surface-amber: #fff7ea;
  --surface-violet: #f6f1fb;
  --navy: #173f63;
  --navy-2: #0f3150;
  --blue: #245f8a;
  --green: #0f6f58;
  --amber: #985207;
  --red: #b54141;
  --violet: #6b4ba1;
  --shadow-sm: 0 1px 2px rgb(15 49 80 / 7%);
  --shadow-md: 0 10px 30px rgb(15 49 80 / 16%);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 16px;
  --focus: 0 0 0 3px rgb(44 111 159 / 22%);
  --sidebar: 264px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f3f6f8; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f3f6f8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
img, svg { display: block; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 9999;
  inset-inline-start: 1rem;
  top: -5rem;
  background: var(--ink);
  color: white;
  padding: .65rem 1rem;
  border-radius: 0 0 .6rem .6rem;
}
.skip-link:focus-visible { top: 0; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .65rem;
  color: var(--muted);
}
.boot-screen strong { color: var(--ink); font-size: 1.15rem; }
.boot-screen p { margin: 0; }

.brand-mark {
  width: 42px;
  height: 42px;
  position: relative;
  border-radius: 11px;
  background: var(--navy);
  color: white;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  direction: ltr;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: #f3f6f8;
}
.login-panel {
  display: grid;
  align-content: center;
  padding: 2.25rem;
  max-width: 460px;
  width: 100%;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.login-brand { display: flex; align-items: center; gap: .85rem; margin-bottom: 2.4rem; }
.login-brand-copy strong { display: block; font-size: 1.1rem; letter-spacing: -.02em; }
.login-brand-copy span { color: var(--muted); font-size: .88rem; }
.login-panel h1 { margin: 0 0 .55rem; font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; }
.login-panel > p { margin: 0 0 2rem; color: var(--muted); font-size: 1.02rem; max-width: 32rem; }
.login-form { display: grid; gap: 1rem; }
.login-actions { margin-top: .4rem; }
.login-demo {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.login-demo > span { color: var(--muted); font-size: .82rem; display: block; margin-bottom: .6rem; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1rem;
  border-inline-end: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: .15rem .55rem 1.7rem; }
.sidebar-brand strong { display: block; font-size: 1.04rem; }
.sidebar-brand small { display: block; color: var(--muted); margin-top: .1rem; }
.nav-label { color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .08em; padding: .65rem .75rem .45rem; text-transform: uppercase; }
.nav-list { display: grid; gap: .35rem; }
.nav-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .72rem .8rem;
  border-radius: 12px;
  text-align: start;
  font-weight: 680;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-button:hover { background: var(--surface-soft); color: var(--navy); }
.nav-button:active { transform: translateY(1px); }
.nav-button.active { color: white; background: var(--navy); }
.nav-icon { width: 21px; height: 21px; display: grid; place-items: center; flex: 0 0 21px; }
.nav-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { margin-inline-start: auto; min-width: 1.55rem; height: 1.55rem; border-radius: 999px; display: grid; place-items: center; padding-inline: .35rem; font-size: .7rem; background: #e6edf3; color: var(--muted); }
.nav-button.active .nav-count { color: var(--navy); background: white; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 1.2rem .55rem .25rem; }
.portal-info-link { display: inline-block; color: var(--muted); font-size: .82rem; margin-bottom: 1rem; text-underline-offset: 3px; }
.portal-info-link:hover { color: var(--navy); }
.user-chip { display: flex; align-items: center; gap: .7rem; margin-bottom: .75rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-green); color: var(--green); font-weight: 800; flex: 0 0 auto; }
.user-chip strong { display: block; font-size: .9rem; }
.user-chip small { color: var(--muted); }
.logout-button { border: 0; background: transparent; color: var(--muted); padding: .35rem 0; }
.logout-button:hover { color: var(--red); }

.workspace { min-width: 0; }
.mobile-header, .mobile-nav { display: none; }
.mobile-cols-3 { --mobile-tabs: 3; }
.mobile-cols-5 { --mobile-tabs: 5; }
.page-header {
  min-height: 68px;
  padding: .75rem clamp(1rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
}
.page-header-title { min-width: 0; }
.page-header-title strong { display: block; font-size: .97rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-header-title span { color: var(--muted); font-size: .8rem; }
.page-header-actions { display: flex; align-items: center; gap: .55rem; }
.page-content { padding: clamp(1rem, 3vw, 2.4rem); max-width: 1460px; margin-inline: auto; width: 100%; }
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.eyebrow { color: var(--muted); font-size: .78rem; font-weight: 700; }
.hero-row h1 { margin: 0 0 .35rem; font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; }
.hero-row p { margin: 0; color: var(--muted); font-size: 1rem; max-width: 52rem; }
.hero-actions { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: end; }

/* Generic components */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-header { padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.08rem; letter-spacing: -.02em; }
.card-header p { margin: .2rem 0 0; color: var(--muted); font-size: .84rem; }
.card-body { padding: 1.25rem; }
.card-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--line); background: #fbfcfd; border-radius: 0 0 var(--radius) var(--radius); }

.button {
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--navy);
  padding: .6rem .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  font-weight: 740;
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.button:hover { border-color: #9db2c5; background: var(--surface-soft); }
.button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: var(--focus); }
.button.primary { color: white; background: var(--navy); border-color: var(--navy); }
.button.primary:hover { background: var(--navy-2); }
.button.green { color: white; background: var(--green); border-color: var(--green); }
.button.red { color: var(--red); border-color: #e2b8b8; background: #fffafa; }
.button.amber { color: #8c4d08; border-color: #ecd0a5; background: var(--surface-amber); }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.small { min-height: 34px; padding: .4rem .7rem; font-size: .82rem; border-radius: 9px; }
.button.block { width: 100%; }
.button[disabled] { opacity: .52; cursor: not-allowed; box-shadow: none; transform: none; }
.button svg, .icon-button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 11px; }
.icon-button:hover { color: var(--navy); border-color: var(--line-strong); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 26px;
  border-radius: 999px;
  padding: .25rem .65rem;
  background: #edf3f7;
  color: var(--blue);
  border: 1px solid #d1e2ee;
  font-size: .75rem;
  font-weight: 750;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--green); background: var(--surface-green); border-color: #c8e8dc; }
.badge.amber { color: var(--amber); background: var(--surface-amber); border-color: #f0d7ae; }
.badge.red { color: var(--red); background: #fff1f1; border-color: #efcccc; }
.badge.violet { color: var(--violet); background: var(--surface-violet); border-color: #ded0ef; }
.badge.gray { color: var(--muted); background: #f1f4f6; border-color: #dfe5ea; }
.badge.no-dot::before { display: none; }

.field { display: grid; gap: .42rem; }
.field label, .field-label { color: var(--ink-2); font-weight: 720; font-size: .86rem; }
.field label .required { color: var(--red); }
.field-hint { color: var(--muted); font-size: .77rem; }
.field-error { color: var(--red); font-size: .77rem; min-height: 1em; }
.input, input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="password"], textarea, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  padding: .7rem .8rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.55; }
input:hover, textarea:hover, select:hover { border-color: #9fb2c3; }
input::placeholder, textarea::placeholder { color: #65768a; opacity: 1; }
input.invalid, textarea.invalid, select.invalid { border-color: var(--red); }
input[disabled], textarea[disabled], select[disabled] { background: var(--surface-soft); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-start; gap: .65rem; flex-wrap: wrap; margin-top: .4rem; }
.checkbox-row { display: flex; align-items: flex-start; gap: .65rem; }
.checkbox-row input { width: 18px; height: 18px; min-height: auto; flex: 0 0 auto; margin-top: .12rem; accent-color: var(--navy); }
.checkbox-row label { font-size: .86rem; color: var(--ink-2); }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.checkbox-card { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--line); border-radius: 10px; padding: .68rem .75rem; background: var(--surface-soft); }
.checkbox-card input { width: 17px; height: 17px; accent-color: var(--navy); }
.submission-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, .6fr);
  gap: 1rem;
  align-items: start;
}
.sticky-card {
  position: sticky;
  top: 84px;
}
.check-list {
  display: grid;
  gap: .85rem;
}
.check-list > span {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  color: var(--ink-2);
  font-size: .86rem;
}
.check-list svg {
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 50%;
  stroke: var(--green);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: var(--surface-green);
}
.file-drop {
  border: 1.5px dashed #9bb5c9;
  border-radius: 12px;
  min-height: 118px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  background: #f8fbfd;
  color: var(--muted);
  position: relative;
  overflow: hidden;
}
.file-drop > span {
  display: grid;
  justify-items: center;
  gap: .15rem;
  max-width: 100%;
  pointer-events: none;
}
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: var(--focus); }
.file-drop svg {
  width: 34px;
  height: 34px;
  margin-bottom: .4rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.file-drop strong { color: var(--navy); display: block; margin-bottom: .1rem; }
.file-drop small { display: block; margin-top: .1rem; }
.file-drop.has-file { border-style: solid; border-color: #8ccbb8; background: var(--surface-green); color: var(--green); }
.file-drop.has-file strong { color: var(--green); }

.info-box { padding: .85rem 1rem; border-radius: 11px; background: var(--surface-blue); color: var(--navy); border: 1px solid #c9dfef; font-size: .86rem; }
.info-box.amber { background: var(--surface-amber); color: #7f4a0c; border-color: #ecd0a5; }
.info-box.red { background: #fff3f3; color: #8e3030; border-color: #e9c4c4; }
.info-box.green { background: var(--surface-green); color: #126d58; border-color: #c3e5da; }
.empty-state { padding: 3rem 1.5rem; text-align: center; color: var(--muted); }
.empty-state-icon { width: 54px; height: 54px; border-radius: 18px; background: var(--surface-blue); color: var(--blue); display: grid; place-items: center; margin: 0 auto 1rem; font-size: 1.35rem; }
.empty-state h3 { margin: 0 0 .35rem; color: var(--ink); }
.empty-state p { margin: 0 auto 1.1rem; max-width: 30rem; }

/* Overview */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat-card { min-height: 112px; padding: 1.15rem; border: 0; border-radius: 0; border-inline-end: 1px solid var(--line); }
.stat-card:last-child { border-inline-end: 0; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 720; }
.stat-value { display: block; font-size: 2rem; line-height: 1; margin: .7rem 0 .5rem; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.stat-meta { color: var(--muted); font-size: .75rem; }
.stat-card.blue { color: var(--blue); }
.stat-card.amber { color: var(--amber); }
.stat-card.violet { color: var(--violet); }
.stat-card.green { color: var(--green); }
.stat-card .stat-label, .stat-card .stat-meta { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, .82fr); gap: 1rem; align-items: start; }
.stack { display: grid; gap: 1rem; }
.job-summary h3 { margin: .25rem 0 .2rem; font-size: 1.3rem; }
.job-summary p { margin: 0; color: var(--muted); }
.job-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; }
.attention-list { display: grid; gap: .55rem; }
.attention-item { padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: .65rem; }
.attention-item strong { display: block; font-size: .88rem; }
.attention-item small { color: var(--muted); }

/* Data table and submission cards */
.table-wrap { overflow-x: auto; scrollbar-width: thin; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { color: var(--muted); font-size: .72rem; font-weight: 760; text-align: right; padding: .8rem 1rem; background: #f7f9fb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: .95rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .86rem; font-variant-numeric: tabular-nums; }
.data-table tbody tr { transition: background .13s ease; }
.data-table tbody tr:hover { background: #fafcfd; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.row-button { display: flex; align-items: center; gap: .7rem; border: 0; background: transparent; color: inherit; text-align: start; padding: 0; width: 100%; }
.initials { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-blue); color: var(--navy); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.person strong { display: block; font-size: .88rem; }
.person small { display: block; color: var(--muted); font-size: .72rem; margin-top: .1rem; }
.mobile-submission-list { display: none; padding: .8rem; gap: .65rem; }
.submission-card { border: 1px solid var(--line); border-radius: 13px; padding: .9rem; background: white; }
.submission-card-top { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.submission-card h3 { margin: 0; font-size: .97rem; }
.submission-card p { margin: .16rem 0 0; color: var(--muted); font-size: .76rem; }
.submission-card-bottom { margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; }
.filters { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: 1rem; }
.search-box { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-box input { padding-inline-start: 2.45rem; }
.search-box svg { position: absolute; inset-inline-start: .82rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 2; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #eef2f5; overflow-x: auto; max-width: 100%; }
.segmented button { min-height: 34px; border: 0; border-radius: 8px; padding: .4rem .7rem; background: transparent; color: var(--muted); white-space: nowrap; font-size: .78rem; font-weight: 700; }
.segmented button.active { background: white; color: var(--navy); box-shadow: 0 1px 5px rgb(15 49 80 / 10%); }

/* Pipeline */
.pipeline-board { display: grid; grid-template-columns: repeat(var(--pipeline-columns, 4), minmax(230px, 1fr)); gap: .85rem; overflow-x: auto; padding-bottom: .6rem; scroll-snap-type: x proximity; }
.pipeline-column { min-width: 230px; border: 1px solid var(--line); border-radius: var(--radius); background: #eef2f5; min-height: 360px; scroll-snap-align: start; }
.pipeline-column-header { padding: .85rem .9rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-bottom: 1px solid var(--line); }
.pipeline-column-header strong { font-size: .84rem; }
.pipeline-column-header span { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 999px; background: white; color: var(--muted); font-size: .72rem; }
.pipeline-cards { display: grid; gap: .6rem; padding: .7rem; }
.pipeline-card { border: 1px solid var(--line); border-radius: 11px; background: white; padding: .8rem; }
.pipeline-card button { border: 0; padding: 0; background: transparent; text-align: start; color: inherit; width: 100%; }
.pipeline-card strong { display: block; font-size: .87rem; }
.pipeline-card small { display: block; color: var(--muted); margin-top: .18rem; }
.pipeline-card footer { display: flex; justify-content: space-between; align-items: center; padding-top: .65rem; margin-top: .65rem; border-top: 1px solid var(--line); font-size: .7rem; color: var(--muted); }

/* Connector */
.connector-job {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.job-main { padding: clamp(1.2rem, 3vw, 2rem); }
.job-main h2 { margin: .35rem 0 .6rem; font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -.045em; }
.job-main>.job-content { margin-top: 1rem; }
.job-section { margin-top: 1.4rem; }
.job-section h3 { font-size: .9rem; margin: 0 0 .5rem; color: var(--muted); }
.job-section .job-content h3 { font-size: 1em; color: var(--ink); }
.job-side { padding: 1.25rem; display: grid; align-content: space-between; gap: 1rem; }
.job-side .side-facts { display: grid; gap: .7rem; }
.fact { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact span { color: var(--muted); font-size: .78rem; }
.fact strong { text-align: end; font-size: .83rem; }
.connector-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.connector-stat { padding: 1rem; }
.connector-stat strong { display: block; font-size: 1.65rem; margin-top: .35rem; }
.connector-stat span { color: var(--muted); font-size: .76rem; }

/* Modal and drawer */
.modal {
  border: 0;
  padding: 0;
  width: min(760px, calc(100vw - 2rem));
  max-height: min(88vh, 900px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: contain;
}
.modal::backdrop { background: rgb(15 28 43 / 55%); }
.modal-shell { max-height: min(88vh, 900px); display: flex; flex-direction: column; }
.modal-header { padding: 1.05rem 1.2rem; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; background: white; position: sticky; top: 0; z-index: 2; }
.modal-header h2 { margin: .2rem 0 0; font-size: 1.35rem; letter-spacing: -.035em; }
.modal-header p { margin: .2rem 0 0; color: var(--muted); font-size: .8rem; }
.modal-body { padding: 1.2rem; overflow-y: auto; overscroll-behavior: contain; }
.modal-footer { padding: .9rem 1.2rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; justify-content: flex-start; background: #fbfcfd; position: sticky; bottom: 0; }
.close-button { flex: 0 0 auto; }
.detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; }
.detail-section { border: 1px solid var(--line); border-radius: 13px; padding: 1rem; }
.detail-section h3 { margin: 0 0 .8rem; font-size: .9rem; }
.detail-list { display: grid; gap: .7rem; }
.detail-row { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: .8rem; align-items: start; }
.detail-row dt { color: var(--muted); font-size: .76rem; }
.detail-row dd { margin: 0; font-size: .84rem; overflow-wrap: anywhere; }
.rationale-box { white-space: pre-line; color: var(--ink-2); font-size: .88rem; line-height: 1.6; }
.decision-panel { margin-top: 1rem; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.decision-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.decision-tabs button { border: 0; background: transparent; padding: .75rem .5rem; color: var(--muted); font-weight: 720; }
.decision-tabs button.active { color: var(--navy); background: white; box-shadow: inset 0 -2px var(--navy); }
.decision-content { padding: 1rem; }
.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: .65rem; position: relative; padding-bottom: .9rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; top: 22px; right: 11px; bottom: 0; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-blue); color: var(--blue); font-size: .65rem; z-index: 1; }
.timeline-copy strong { display: block; font-size: .8rem; }
.timeline-copy p { margin: .15rem 0 0; color: var(--muted); font-size: .74rem; white-space: pre-line; }
.timeline-copy time { color: var(--muted-2); font-size: .68rem; }
.action-menu { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Job settings */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .55fr); gap: 1rem; align-items: start; }
.pipeline-editor { display: grid; gap: .55rem; }
.pipeline-editor-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 38px; gap: .5rem; align-items: center; }
.pipeline-number { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-blue); color: var(--navy); font-size: .75rem; font-weight: 800; }
.status-actions { display: grid; gap: .55rem; }
.status-actions .button { justify-content: flex-start; }

/* Toast */
.toast-region { position: fixed; z-index: 9999; inset-inline-start: 1rem; bottom: 1rem; width: min(420px, calc(100vw - 2rem)); display: grid; gap: .6rem; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .7rem; background: var(--ink); color: white; border-radius: 12px; padding: .85rem 1rem; box-shadow: 0 12px 36px rgb(15 28 43 / 30%); animation: toast-in .2s ease both; }
.toast.error { background: #8f3030; }
.toast.success { background: #136f59; }
.toast strong { display: block; font-size: .83rem; }
.toast p { margin: .1rem 0 0; color: rgb(255 255 255 / 75%); font-size: .76rem; }
.toast button { margin-inline-start: auto; border: 0; background: transparent; color: white; font-size: 1.1rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.loading-overlay { position: fixed; inset: 0; z-index: 9000; background: rgb(243 246 248 / 78%); display: grid; place-items: center; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #d6e1e9; border-top-color: var(--navy); animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: white; color: var(--muted); padding: .08rem .35rem; font-size: .68rem; }
.muted { color: var(--muted); }
.small-text { font-size: .78rem; }
.hero-row h1, .card-header h2, .card-header h3, .modal-header h2 { text-wrap: balance; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.nowrap { white-space: nowrap; }
:where(time,bdi,.numeric,.nowrap,.stat-value,.overview-counts dd,.job-line-summary strong,input[type="number"],input[type="month"],input[type="tel"]) { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1120px) {
  :root { --sidebar: 230px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card:nth-child(2) { border-inline-end: 0; }
  .stat-card:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .connector-job, .settings-layout, .submission-form-layout { grid-template-columns: minmax(0, 1fr); }
  .sticky-card { position: static; }
  .connector-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  body { background: #f3f6f8; }
  .login-page { grid-template-columns: 1fr; }
  .login-panel { min-height: 100vh; padding: 1.4rem 1.1rem 2rem; align-content: center; }
  .login-visual { display: none; }
  .login-brand { margin-bottom: 2.1rem; }
  .login-panel h1 { font-size: 2.2rem; }
  .demo-grid { grid-template-columns: 1fr; }

  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { padding-bottom: 76px; }
  .mobile-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .mobile-brand { display: flex; align-items: center; gap: .6rem; }
  .mobile-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .mobile-brand strong { font-size: .9rem; }
  .mobile-user { display: flex; align-items: center; gap: .5rem; }
  .mobile-help-link { color: var(--muted); font-size: .78rem; font-weight: 700; text-decoration: none; padding: .45rem .25rem; }
  .mobile-help-link:hover { color: var(--navy); }
  .mobile-user .avatar { width: 34px; height: 34px; font-size: .78rem; }
  .mobile-nav {
    position: fixed;
    z-index: 35;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: .45rem .55rem calc(.45rem + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(var(--mobile-tabs, 4), 1fr);
    gap: .25rem;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); border-radius: 10px; display: grid; justify-items: center; align-content: center; gap: .2rem; min-width: 0; font-size: .66rem; font-weight: 720; }
  .mobile-nav button.active { background: var(--surface-blue); color: var(--navy); }
  .mobile-nav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .page-header { display: none; }
  .page-content { padding: 1.1rem 1rem 1.5rem; }
  .hero-row { display: block; margin-bottom: 1rem; }
  .hero-row h1 { font-size: 2rem; }
  .hero-row p { font-size: .9rem; }
  .hero-actions { margin-top: .9rem; justify-content: stretch; }
  .hero-actions .button { flex: 1 1 auto; }
  .stats-grid { grid-template-columns: 1fr; gap: .75rem; }
  .stats-grid { gap: 0; }
  .stat-card, .stat-card:nth-child(2) { min-height: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .stat-card:last-child { border-bottom: 0; }
  .dashboard-grid { gap: .75rem; }
  .card { border-radius: 15px; }
  .card-header { padding: 1rem; }
  .card-body { padding: 1rem; }
  .card-footer { padding: .8rem 1rem; }
  .desktop-table { display: none; }
  .mobile-submission-list { display: grid; }
  .filters { align-items: stretch; }
  .search-box { max-width: none; flex-basis: 100%; }
  .segmented { width: 100%; }
  .segmented button { flex: 1 0 auto; }
  .pipeline-board { grid-template-columns: 1fr; overflow: visible; }
  .pipeline-column { min-width: 0; min-height: auto; }
  .pipeline-cards:empty::after { content: "אין מועמדים בשלב"; color: var(--muted); font-size: .75rem; padding: .5rem; text-align: center; }
  .connector-job { gap: .75rem; }
  .job-main { padding: 1.15rem; }
  .job-side { padding: 1rem; }
  .connector-stats { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .connector-stat { padding: .85rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .submission-form-layout { gap: .75rem; }
  .check-list { gap: .7rem; }
  .settings-layout { gap: .75rem; }
  .modal { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; margin: 0; }
  .modal-shell { height: 100dvh; max-height: none; }
  .modal-header { padding: .9rem 1rem; }
  .modal-body { padding: 1rem; }
  .modal-footer { padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: 100px minmax(0, 1fr); }
  .decision-tabs button { font-size: .77rem; }
  .toast-region { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .page-content { padding-inline: .75rem; }
  .connector-stats { grid-template-columns: 1fr; }
  .hero-row h1 { font-size: 1.8rem; }
  .button { padding-inline: .75rem; }
  .detail-row { grid-template-columns: 1fr; gap: .15rem; }
}

@media print {
  body { background: white; }
  .sidebar, .mobile-header, .mobile-nav, .page-header, .hero-actions, .filters, .button, .icon-button { display: none !important; }
  .app-shell { display: block; }
  .workspace { padding: 0; }
  .page-content { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .pipeline-board { overflow: visible; grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
