:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #061b2d;
  color: #eef9ff;
  --amstad-sky: #5ba7c3;
  --amstad-sky-bright: #8ed5f0;
  --amstad-sky-soft: #d8f3ff;
  --amstad-navy: #061b2d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(142, 213, 240, 0.32), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(91, 167, 195, 0.22), transparent 30rem),
    linear-gradient(135deg, #061b2d 0%, #0b2b44 48%, #071827 100%);
}

.hidden { display: none !important; }

.language-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
}

.language-toggle {
  border: 1px solid rgba(94, 234, 212, 0.42);
  background: rgba(2, 8, 23, 0.72);
  color: #ccfbf1;
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.language-toggle:hover {
  border-color: rgba(94, 234, 212, 0.82);
  color: #ffffff;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-card {
  width: min(560px, 100%);
  padding: 30px;
}
.login-card h1 {
  font-size: clamp(34px, 6vw, 54px);
}
.login-card .subcopy {
  font-size: 16px;
}
.login-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.login-choice-card {
  border: 1px solid rgba(96, 165, 250, 0.32);
  background: rgba(2, 8, 23, 0.48);
  color: #dbeafe;
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 8px;
  text-align: left;
  font: inherit;
}
.login-choice-card strong {
  color: #eef5ff;
  font-size: 18px;
}
.login-choice-card span {
  color: #98a9bc;
  line-height: 1.35;
}
.choice-button {
  cursor: pointer;
}
.choice-button:hover {
  border-color: rgba(94, 234, 212, 0.72);
  background: rgba(20, 184, 166, 0.12);
}
.active-choice {
  border-color: rgba(94, 234, 212, 0.72);
  background: rgba(20, 184, 166, 0.12);
}
.login-section-title {
  font-size: 20px;
  margin: 12px 0 2px;
}
.login-divider {
  margin: 18px 0 10px;
  color: #8ec5ff;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 900;
}
.admin-login-link {
  width: 100%;
  margin-top: 8px;
}
.employee-corner-login {
  position: fixed;
  right: 18px;
  bottom: 18px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(2, 8, 23, 0.54);
  color: #9fb5cc;
  border-radius: 999px;
  padding: 8px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0.7;
}
.employee-corner-login:hover {
  opacity: 1;
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.5);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 52px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  gap: 18px;
  align-items: center;
}
.brand-logo {
  width: clamp(92px, 14vw, 148px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 243, 255, 0.75);
  border-radius: 24px;
  padding: 10px;
  box-shadow: 0 22px 60px rgba(91, 167, 195, 0.28);
}
.portal-sop {
  margin: 0 0 18px;
}
.sky-panel {
  border-color: rgba(142, 213, 240, 0.42);
  background: linear-gradient(135deg, rgba(91, 167, 195, 0.18), rgba(6, 27, 45, 0.74));
}
.portal-sop h2 {
  margin-bottom: 10px;
  color: #eef9ff;
}
.portal-sop ol {
  margin: 0;
  padding-left: 21px;
  color: #cbefff;
  line-height: 1.55;
}
.portal-sop li + li {
  margin-top: 5px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8ec5ff;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 800;
}

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

h1 {
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.96;
  margin-bottom: 14px;
}

.subcopy {
  max-width: 680px;
  color: #b6c6d9;
  font-size: 18px;
  line-height: 1.5;
}

.status-card, .panel {
  background: rgba(7, 35, 56, 0.84);
  border: 1px solid rgba(142, 213, 240, 0.26);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  border-radius: 22px;
}

.status-card {
  padding: 14px 16px;
  white-space: nowrap;
  color: #d8e9ff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}
.logout-button {
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.24);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.dot {
  width: 10px;
  height: 10px;
  background: #30d158;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(48, 209, 88, 0.12);
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.tab-button {
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(2, 8, 23, 0.45);
  color: #dbeafe;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.tab-button.active {
  color: #06111f;
  background: linear-gradient(135deg, var(--amstad-sky-bright), var(--amstad-sky));
  border-color: transparent;
}
.admin-only-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tab-button.active .admin-only-pill {
  background: rgba(6, 17, 31, 0.16);
  color: #06111f;
}
.admin-only-heading {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tab-page, .admin-tab-page { display: none; }
.tab-page.active, .admin-tab-page.active { display: block; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.panel-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.panel-header h2 { margin-bottom: 6px; }
.panel-header p, small { color: #98a9bc; }

label {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  color: #dbeafe;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 8, 23, 0.72);
  color: #f8fbff;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  border-color: rgba(56, 189, 248, 0.8);
}

.primary, .secondary {
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  font: inherit;
}

.primary {
  width: 100%;
  padding: 15px 18px;
  color: #06111f;
  background: linear-gradient(135deg, var(--amstad-sky-bright), var(--amstad-sky));
  margin-top: 12px;
}

.secondary {
  padding: 11px 13px;
  color: #dff7ff;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.32);
}

.muted-box, .summary, .queue-card {
  background: rgba(2, 8, 23, 0.44);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 15px;
  color: #c3d4e8;
}

.intake-mode-grid,
.handoff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.handoff-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}
.intake-mode-card,
.handoff-card {
  border: 1px solid rgba(96, 165, 250, 0.25);
  background: rgba(15, 23, 42, 0.62);
  border-radius: 16px;
  padding: 13px;
  display: grid;
  gap: 7px;
  color: #c3d4e8;
}
.intake-mode-card {
  grid-template-columns: 22px 1fr;
  align-items: start;
}
.intake-mode-card input {
  width: auto;
  margin: 4px 0 0;
  accent-color: #5eead4;
}
.intake-mode-card span,
.handoff-card p {
  color: #98a9bc;
  margin: 0;
  font-size: 13px;
}
.intake-mode-card strong,
.handoff-card strong {
  color: #eef5ff;
}
.ramp-card {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(20, 184, 166, 0.11);
}
.message-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.6fr);
  gap: 14px;
}
.message-thread-list {
  display: grid;
  gap: 10px;
  align-content: start;
}
.message-thread {
  border: 1px solid rgba(142, 213, 240, 0.22);
  background: rgba(6, 27, 45, 0.58);
  color: #cbefff;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 5px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.message-thread span {
  color: #9dcde0;
  font-size: 13px;
}
.active-message-thread {
  border-color: rgba(142, 213, 240, 0.72);
  background: rgba(91, 167, 195, 0.2);
}
.urgent-thread {
  border-color: rgba(251, 191, 36, 0.55);
}
.message-panel {
  display: grid;
  gap: 12px;
}
.translation-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(142, 213, 240, 0.28);
  background: rgba(142, 213, 240, 0.08);
  border-radius: 14px;
  padding: 10px;
}
.translation-banner p {
  margin: 0;
  color: #cbefff;
}
.chat-bubble {
  max-width: 82%;
  border-radius: 18px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.chat-bubble small {
  color: #9dcde0;
  font-weight: 900;
}
.chat-bubble p {
  margin: 0;
}
.admin-bubble {
  justify-self: start;
  background: rgba(142, 213, 240, 0.16);
  border: 1px solid rgba(142, 213, 240, 0.28);
}
.contractor-bubble {
  justify-self: end;
  background: rgba(20, 184, 166, 0.14);
  border: 1px solid rgba(94, 234, 212, 0.24);
}
.icon-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.line-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.line-items-header h3 { margin-bottom: 4px; }
.line-items-header p { color: #98a9bc; margin-bottom: 0; }
.add-line-bottom {
  width: 100%;
  margin: 6px 0 16px;
  position: sticky;
  bottom: 12px;
  z-index: 5;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
}

.line-item {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  align-items: center;
}

.line-card {
  background: rgba(2, 8, 23, 0.34);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 12px;
}

.line-top-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.flat-fields { display: grid; }
.hourly-fields {
  display: none;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
}
.hourly-field {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #a9c7e8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.hourly-field input {
  margin: 0;
}
.line-card.is-hourly .flat-fields { display: none; }
.line-card.is-hourly .hourly-fields { display: grid; }
.calculated-total {
  border: 1px solid rgba(94, 234, 212, 0.32);
  background: rgba(20, 184, 166, 0.1);
  color: #ccfbf1;
  border-radius: 14px;
  padding: 13px 14px;
  font-weight: 900;
}

.remove-line {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.3);
  cursor: pointer;
}

.summary dl { margin: 0; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.summary-row:last-child { border-bottom: 0; }
.summary dt { color: #98a9bc; }
.summary dd { margin: 0; text-align: right; font-weight: 800; }

.admin-panel, .account-panel { margin-top: 20px; }
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
  margin-bottom: 14px;
}
.account-card, .history-card {
  background: rgba(2, 8, 23, 0.44);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 15px;
  color: #c3d4e8;
}
.account-card h3, .history-card h3 { color: #eef5ff; margin-bottom: 8px; }
.account-card ul { margin: 0; padding-left: 20px; }
.profile-panel {
  margin: 16px 0;
}
.profile-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.profile-header h3 { margin-bottom: 6px; color: #eef5ff; }
.profile-header p { margin-bottom: 0; color: #98a9bc; }
.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.profile-form label { margin: 0; }
.profile-form button, .profile-form .warning-note {
  grid-column: 1 / -1;
}
.vendor-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.vendor-doc-card {
  background: rgba(2, 8, 23, 0.44);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 15px;
}
.vendor-doc-card h4 {
  margin: 0 0 8px;
  color: #eef5ff;
}
.vendor-doc-card p {
  color: #c3d4e8;
}
.vendor-doc-card label {
  margin-bottom: 0;
}
.warning-note {
  border: 1px solid rgba(251, 191, 36, 0.7);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
}
.inline-status {
  border: 1px solid rgba(94, 234, 212, 0.45);
  background: rgba(20, 184, 166, 0.13);
  color: #ccfbf1;
  border-radius: 14px;
  padding: 11px 13px;
  font-weight: 850;
}
.inline-status.warning {
  border-color: rgba(251, 191, 36, 0.7);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}
.muted-badge {
  background: #93c5fd;
}
.history, .queue {
  display: block;
}
.table-shell {
  overflow-x: auto;
}
.data-table {
  min-width: 980px;
  display: grid;
  gap: 8px;
}
.table-row {
  display: grid;
  gap: 10px;
  align-items: center;
  background: rgba(2, 8, 23, 0.44);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 12px;
  color: #c3d4e8;
}
.contractor-table .table-row {
  grid-template-columns: 1.1fr 0.75fr 1.4fr 0.65fr 1.1fr 0.75fr 1fr;
}
.admin-table .table-row {
  grid-template-columns: 1.1fr 0.95fr 0.75fr 1.35fr 0.65fr 1.05fr 0.75fr 0.9fr 1.25fr;
}
.access-panel, .access-heading {
  margin-bottom: 18px;
}
.user-access-table {
  min-width: 1080px;
}
.user-access-table .table-row {
  grid-template-columns: 1.2fr repeat(7, minmax(112px, 0.75fr)) 1fr;
}
.subcontractor-table {
  min-width: 1220px;
}
.subcontractor-table .table-row {
  grid-template-columns: 1.35fr 0.75fr 0.9fr 1.2fr 0.7fr 0.9fr 1.35fr;
}
.market-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.market-chip {
  display: inline-flex;
  border: 1px solid rgba(94, 234, 212, 0.3);
  background: rgba(20, 184, 166, 0.12);
  color: #ccfbf1;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}
.subcontractor-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.subcontractor-form label:last-of-type,
.subcontractor-form .success-actions {
  grid-column: 1 / -1;
}
.permission-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 900;
}
.permission-toggle input {
  width: auto;
  accent-color: #5eead4;
}
.permission-toggle span {
  min-width: 24px;
}
.table-head {
  background: rgba(96, 165, 250, 0.13);
  color: #eaf4ff;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}
.queue-card h3 { margin-bottom: 8px; }
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  color: #06111f;
  background: #fbbf24;
  font-size: 12px;
  font-weight: 900;
}
.warning-card {
  border-color: rgba(251, 191, 36, 0.72);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 20px 60px rgba(0, 0, 0, 0.28);
}
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
}
.admin-actions button {
  border: 1px solid rgba(96, 165, 250, 0.32);
  background: rgba(59, 130, 246, 0.16);
  color: #dff7ff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
}
.admin-line-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.admin-line-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 8px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 8, 23, 0.34);
  border-radius: 10px;
  padding: 8px;
  font-size: 12px;
}
.admin-line-chip small {
  grid-column: 1 / -1;
}
.revision-editor-row {
  grid-template-columns: 1fr !important;
  border-color: rgba(94, 234, 212, 0.62);
  background: rgba(20, 184, 166, 0.08);
}
.revision-editor {
  width: 100%;
}
.revision-line-item {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.65fr 0.9fr;
  gap: 12px;
  align-items: end;
}
.revision-line-item label {
  margin: 0;
}
.revision-line-item .primary {
  margin: 0;
  height: 48px;
}
.modal-open {
  overflow: hidden;
}
.success-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 23, 0.72);
  backdrop-filter: blur(12px);
}
.success-card {
  position: relative;
  width: min(440px, 100%);
  overflow: hidden;
  text-align: center;
  border-color: rgba(94, 234, 212, 0.45);
  animation: successPop 0.34s ease-out;
}
.success-check {
  width: 82px;
  height: 82px;
  margin: 4px auto 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #06111f;
  background: linear-gradient(135deg, var(--amstad-sky-bright), var(--amstad-sky));
  font-size: 48px;
  font-weight: 1000;
  box-shadow: 0 0 0 10px rgba(94, 234, 212, 0.12), 0 20px 60px rgba(96, 165, 250, 0.35);
  animation: checkBounce 0.62s ease-out;
}
.success-card h2 {
  margin-bottom: 10px;
}
.success-card .subcopy {
  margin: 0 auto 18px;
  font-size: 16px;
}
.success-actions {
  display: grid;
  gap: 10px;
}
.success-burst span {
  position: absolute;
  width: 8px;
  height: 22px;
  border-radius: 999px;
  background: #5eead4;
  opacity: 0.8;
  animation: confettiDrop 1.2s ease-out infinite alternate;
}
.success-burst span:nth-child(1) { top: 18px; left: 18%; transform: rotate(18deg); background: #60a5fa; }
.success-burst span:nth-child(2) { top: 34px; right: 18%; transform: rotate(-24deg); background: #fbbf24; animation-delay: 0.12s; }
.success-burst span:nth-child(3) { top: 116px; left: 9%; transform: rotate(-10deg); background: #5eead4; animation-delay: 0.2s; }
.success-burst span:nth-child(4) { top: 124px; right: 10%; transform: rotate(28deg); background: #f472b6; animation-delay: 0.28s; }
.success-burst span:nth-child(5) { bottom: 72px; left: 14%; transform: rotate(38deg); background: #a78bfa; animation-delay: 0.18s; }
.success-burst span:nth-child(6) { bottom: 82px; right: 14%; transform: rotate(-38deg); background: #34d399; animation-delay: 0.34s; }
.warning-icon {
  width: 74px;
  height: 74px;
  margin: 4px auto 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #422006;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  font-size: 42px;
  font-weight: 1000;
  box-shadow: 0 0 0 10px rgba(251, 191, 36, 0.12), 0 20px 60px rgba(245, 158, 11, 0.28);
}
.duplicate-details {
  text-align: left;
  margin: 14px 0;
  line-height: 1.55;
}
.doc-form-card {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
}
.electronic-doc-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.electronic-doc-form label {
  margin: 0;
}
.electronic-doc-form button {
  grid-column: 1 / -1;
}

@keyframes successPop {
  from { transform: translateY(12px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes checkBounce {
  0% { transform: scale(0.45); opacity: 0; }
  58% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes confettiDrop {
  from { translate: 0 -4px; opacity: 0.45; }
  to { translate: 0 8px; opacity: 1; }
}

@media (max-width: 880px) {
  .hero, .grid { grid-template-columns: 1fr; display: grid; }
  .brand-lockup { display: grid; gap: 12px; }
  .brand-logo { width: 112px; border-radius: 18px; }
  .status-card { white-space: normal; }
  .line-item, .line-top-row, .line-card.is-hourly .hourly-fields, .profile-form, .login-choice-grid, .vendor-doc-grid, .revision-line-item { grid-template-columns: 1fr; }
  .queue, .history, .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(142, 213, 240, 0.2), transparent 24rem),
      linear-gradient(160deg, #061b2d 0%, #0b2b44 55%, #071827 100%);
  }

  .language-switcher {
    top: 10px;
    right: 10px;
  }

  .language-toggle {
    padding: 8px 11px;
    font-size: 12px;
  }

  .login-page {
    align-items: start;
    padding: 56px 12px 22px;
  }

  .login-card,
  .panel {
    border-radius: 18px;
    padding: 16px;
  }

  .login-card h1,
  h1 {
    font-size: 34px;
    line-height: 1.02;
  }

  h2 { font-size: 23px; }
  h3 { font-size: 18px; }

  .subcopy {
    font-size: 15px;
    line-height: 1.42;
  }

  .shell {
    width: min(100% - 18px, 1180px);
    padding: 54px 0 28px;
  }

  .hero {
    gap: 12px;
    margin-bottom: 16px;
  }

  .status-actions {
    justify-items: stretch;
  }

  .status-card,
  .logout-button {
    width: 100%;
    justify-content: center;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 2px 8px;
    margin-bottom: 10px;
    scrollbar-width: thin;
  }

  .tab-button {
    flex: 0 0 auto;
    padding: 10px 13px;
    font-size: 14px;
  }

  label {
    margin: 12px 0;
    font-size: 14px;
  }

  input,
  select,
  textarea,
  .primary,
  .secondary {
    min-height: 46px;
    font-size: 16px;
  }

  .grid {
    gap: 12px;
  }

  .intake-mode-grid,
  .handoff-grid,
  .message-layout,
  .subcontractor-form {
    grid-template-columns: 1fr;
  }

  .panel-header {
    padding-bottom: 12px;
    margin-bottom: 14px;
  }

  .line-items-header {
    margin-top: 14px;
  }

  .line-card {
    position: relative;
    padding: 14px;
  }

  .line-top-row {
    display: block;
  }

  .line-top-row select {
    padding-right: 56px;
  }

  .remove-line {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    z-index: 2;
    background: rgba(127, 29, 29, 0.55);
  }

  .add-line-bottom {
    position: sticky;
    bottom: 8px;
    margin: 10px 0 14px;
  }

  .summary-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .summary dd {
    text-align: left;
  }

  .profile-header {
    display: grid;
    gap: 10px;
  }

  .table-shell {
    overflow-x: visible;
  }

  .data-table,
  .user-access-table,
  .subcontractor-table {
    min-width: 0;
    gap: 12px;
  }

  .table-head {
    display: none;
  }

  .table-row,
  .contractor-table .table-row,
  .admin-table .table-row,
  .user-access-table .table-row,
  .subcontractor-table .table-row {
    grid-template-columns: 1fr !important;
    gap: 9px;
    padding: 14px;
    border-radius: 16px;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .admin-actions button,
  .admin-actions .badge {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    text-align: center;
  }

  .admin-line-list {
    margin-top: 8px;
  }

  .admin-line-chip {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .revision-editor-row {
    padding: 12px;
  }

  .revision-editor {
    padding: 2px;
  }

  .revision-line-item {
    gap: 10px;
  }

  .electronic-doc-form {
    grid-template-columns: 1fr;
  }

  .doc-form-card {
    max-height: 88vh;
  }

  .revision-line-item .primary {
    width: 100%;
    height: auto;
    min-height: 50px;
  }

  .permission-toggle {
    justify-content: space-between;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 8, 23, 0.28);
    border-radius: 12px;
    padding: 10px 12px;
  }

  .employee-corner-login {
    right: 10px;
    bottom: 10px;
  }
}

@media (max-width: 420px) {
  .admin-actions {
    grid-template-columns: 1fr;
  }

  .login-card h1,
  h1 {
    font-size: 30px;
  }

  .tab-button {
    font-size: 13px;
  }
}


/* Light blue facade refresh */
:root {
  color-scheme: light;
  --amstad-sky: #68b7d4;
  --amstad-sky-bright: #b8ebff;
  --amstad-sky-soft: #effbff;
  --amstad-navy: #0f3854;
}
body {
  background:
    radial-gradient(circle at top left, rgba(184, 235, 255, 0.95), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(104, 183, 212, 0.45), transparent 34rem),
    linear-gradient(135deg, #eaf9ff 0%, #d5f1fb 48%, #f7fcff 100%);
  color: #12344b;
}
.language-toggle,
.employee-corner-login,
.tab-button {
  background: rgba(255, 255, 255, 0.74);
  color: #14506e;
  border-color: rgba(104, 183, 212, 0.42);
  box-shadow: 0 14px 34px rgba(35, 116, 149, 0.12);
}
.language-toggle:hover,
.employee-corner-login:hover,
.tab-button:hover {
  color: #0b3650;
  border-color: rgba(104, 183, 212, 0.78);
  background: rgba(255, 255, 255, 0.92);
}
.status-card,
.panel {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(104, 183, 212, 0.32);
  box-shadow: 0 20px 54px rgba(35, 116, 149, 0.14);
}
.status-card,
label,
.portal-sop ol,
.muted-box,
.summary,
.queue-card,
.table-row,
.message-thread,
.message-panel,
.vendor-doc-card,
.profile-panel,
.intake-mode-card,
.handoff-card {
  color: #183d56;
}
h1, h2, h3,
.portal-sop h2,
.vendor-doc-card h4,
.intake-mode-card strong,
.handoff-card strong,
.login-choice-card strong {
  color: #0b2f47;
}
.subcopy,
.panel-header p,
small,
.intake-mode-card span,
.handoff-card p,
.message-thread span,
.vendor-doc-card p,
.account-card p,
.profile-panel p {
  color: #45687d;
}
.eyebrow {
  color: #237a9c;
}
.sky-panel {
  background: linear-gradient(135deg, rgba(184, 235, 255, 0.78), rgba(255, 255, 255, 0.82));
  border-color: rgba(104, 183, 212, 0.44);
}
input,
select,
textarea {
  background: rgba(255, 255, 255, 0.9);
  color: #14344a;
  border-color: rgba(104, 183, 212, 0.42);
}
input::placeholder,
textarea::placeholder {
  color: #7795a7;
}
.muted-box,
.summary,
.queue-card,
.message-thread,
.vendor-doc-card,
.account-card,
.profile-panel,
.intake-mode-card,
.handoff-card,
.table-row {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(104, 183, 212, 0.24);
}
.active-message-thread,
.ramp-card {
  background: rgba(184, 235, 255, 0.56);
  border-color: rgba(104, 183, 212, 0.55);
}
.table-head {
  background: rgba(197, 238, 252, 0.72);
  color: #164965;
}
.secondary,
.admin-actions button {
  background: rgba(232, 248, 255, 0.82);
  color: #124662;
  border-color: rgba(104, 183, 212, 0.42);
}
.primary,
.tab-button.active {
  background: linear-gradient(135deg, #b8ebff, #68b7d4);
  color: #082c42;
}
.logout-button {
  background: rgba(255, 255, 255, 0.72);
  color: #b42318;
  border-color: rgba(248, 113, 113, 0.45);
}
.brand-logo,
.login-logo {
  background: #ffffff;
  border-color: rgba(104, 183, 212, 0.38);
  box-shadow: 0 22px 48px rgba(35, 116, 149, 0.18);
}
.login-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.login-logo {
  width: 86px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 20px;
  padding: 8px;
}
.login-logo-row .eyebrow {
  margin: 0;
}
.portal-email-card {
  display: grid;
  gap: 7px;
  margin: 18px 0;
  padding: 15px;
  border-radius: 18px;
  border: 1px solid rgba(104, 183, 212, 0.36);
  background: rgba(232, 248, 255, 0.82);
  color: #183d56;
}
.portal-email-card strong {
  color: #0b2f47;
  font-size: 22px;
}
.portal-email-card p {
  margin: 0;
  color: #45687d;
  line-height: 1.45;
}
.warning-card {
  background: rgba(255, 250, 226, 0.82) !important;
  border-color: rgba(251, 191, 36, 0.65) !important;
}
.admin-only-heading,
.admin-only-pill {
  color: #8a5a00;
  background: rgba(251, 191, 36, 0.24);
}


/* QA polish overrides */
.add-line-bottom {
  position: static;
  box-shadow: none;
  margin: 12px 0 18px;
}
.line-card {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(104, 183, 212, 0.26);
}
.calculated-total {
  background: rgba(232, 248, 255, 0.86);
  color: #124662;
  border-color: rgba(104, 183, 212, 0.38);
}
.remove-line {
  background: rgba(254, 226, 226, 0.92);
  color: #b42318;
  border-color: rgba(248, 113, 113, 0.48);
}
.line-items-header p {
  color: #45687d;
}

.admin-line-chip {
  background: rgba(232, 248, 255, 0.84);
  border-color: rgba(104, 183, 212, 0.28);
  color: #183d56;
}
.admin-line-chip small {
  color: #45687d;
}


.permission-card-list {
  display: grid;
  gap: 14px;
}
.permission-user-card {
  border: 1px solid rgba(104, 183, 212, 0.24);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  padding: 16px;
}
.permission-user-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.permission-user-header h3,
.permission-user-header p {
  margin: 0;
}
.permission-user-header p {
  color: #45687d;
  margin-top: 4px;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.permission-card {
  border: 1px solid rgba(104, 183, 212, 0.22);
  background: rgba(232, 248, 255, 0.72);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.permission-card > span {
  color: #164965;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.permission-actions {
  justify-content: flex-end;
  margin-top: 14px;
}
.permission-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.permission-callout p {
  margin: 0;
  color: #45687d;
  line-height: 1.45;
}
.internal-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.internal-create-form label:nth-of-type(5),
.internal-create-form label:nth-of-type(8),
.internal-create-form button,
.internal-create-form .inline-status {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .internal-create-form,
  .permission-callout {
    grid-template-columns: 1fr;
    display: grid;
  }
}

/* Section-window navigation: TOC home + focused work window */
.shell.toc-mode .tab-page,
.shell.toc-mode .admin-tab-page {
  display: none !important;
}
.shell.section-mode > .hero,
.shell.section-mode > .portal-sop {
  display: none !important;
}
.shell.section-mode .tabs {
  position: sticky;
  top: 12px;
  z-index: 30;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(104, 183, 212, 0.32);
  border-radius: 999px;
  background: rgba(232, 248, 255, 0.86);
  box-shadow: 0 16px 34px rgba(35, 116, 149, 0.14);
  backdrop-filter: blur(12px);
}
.section-window-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px 16px;
}
.section-window-bar h2 {
  margin: 0;
}
.section-window-bar .eyebrow {
  margin-bottom: 4px;
}
.section-step-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}
.compact-nav {
  white-space: nowrap;
}
.compact-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.shell.toc-mode .tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.shell.toc-mode .tab-button {
  min-height: 62px;
  border-radius: 18px;
  text-align: left;
  justify-content: flex-start;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.78);
}
@media (max-width: 720px) {
  .section-window-bar {
    grid-template-columns: 1fr;
  }
  .section-step-actions {
    justify-content: stretch;
  }
  .section-step-actions .compact-nav,
  #vendorBackHome,
  #adminBackHome {
    width: 100%;
  }
  .shell.section-mode .tabs {
    border-radius: 22px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}
