/* Startup-only loading screen. Opaque background conceals incomplete totals. */
.workspace-loading {
  --loading-ink: #10273d;
  --loading-muted: #677587;
  --loading-red: #ca362c;
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(ellipse at 20% 16%, #e5ebf2 0, transparent 48%),
    radial-gradient(ellipse at 85% 86%, #f3e6e3 0, transparent 46%),
    #f6f7f9;
  color: var(--loading-ink);
}
.workspace-loading[hidden] { display: none; }
body:has(.workspace-loading:not([hidden])) { overflow: hidden; }
.workspace-loading__card {
  width: min(100%, 440px);
  box-sizing: border-box;
  padding: 30px 30px 0;
  text-align: center;
  border: 1px solid #fff;
  border-radius: 24px;
  background: linear-gradient(150deg, #fff, #fbfcfe);
  box-shadow: 0 30px 85px #18344c12, 0 3px 10px #18344c05, inset 0 1px 0 #fff;
}
.workspace-loading__brand {
  margin: 0;
  color: var(--loading-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.workspace-loading__scene {
  position: relative;
  width: 220px;
  height: 196px;
  margin: 12px auto 10px;
  perspective: 650px;
  isolation: isolate;
}
.workspace-loading__ground {
  position: absolute;
  width: 148px;
  height: 22px;
  left: 36px;
  bottom: 9px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #10273d28, transparent 72%);
  filter: blur(5px);
}
.workspace-loading__orbit {
  position: absolute;
  box-sizing: border-box;
  border-radius: 50%;
  transform-style: preserve-3d;
}
.workspace-loading__orbit--outer {
  inset: 15px 14px 13px;
  border: 12px solid var(--loading-red);
  border-top-color: #ef6b5c;
  border-right-color: #a42623;
  border-bottom-color: #8f2724;
  box-shadow: inset 0 2px 2px #ffffffa6, inset 0 -4px 2px #6c16163d, 0 5px 0 #982823, 0 10px 17px #99231b18;
  animation: workspace-orbit-outer 3.4s linear infinite;
}
.workspace-loading__orbit--inner {
  inset: 37px 37px 37px;
  border: 7px solid #29445e;
  border-top-color: #69839b;
  border-bottom-color: #10273d;
  box-shadow: inset 0 1px 2px #ffffff91, 0 3px 0 #10273d, 0 6px 12px #10273d1f;
  animation: workspace-orbit-inner 4.8s linear infinite;
}
.workspace-loading__core {
  position: absolute;
  width: 74px;
  height: 74px;
  left: 73px;
  top: 61px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #fff;
  background: radial-gradient(circle at 30% 22%, #fff 0, #f5f8fc 42%, #dce4ee 80%, #b5c1ce 100%);
  box-shadow: inset 2px 3px 5px #fff, inset -3px -4px 9px #6b7c902e, 0 5px 0 #c4ced9, 0 13px 22px #10273d26;
}
.workspace-loading__core span { font-size: 24px; font-weight: 900; letter-spacing: -.06em; }
.workspace-loading__title { margin: 0 0 12px; font-size: clamp(21px, 4.8vw, 26px); line-height: 1.25; letter-spacing: -.035em; color: var(--loading-ink); }
.workspace-loading__description { margin: 0; font-size: 14px; line-height: 1.7; color: var(--loading-muted); }
.workspace-loading__dots { display: flex; justify-content: center; gap: 6px; margin: 23px 0 17px; }
.workspace-loading__dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--loading-red); animation: workspace-loading-dot 1.5s ease-in-out infinite; }
.workspace-loading__dots i:nth-child(2) { animation-delay: .18s; }
.workspace-loading__dots i:nth-child(3) { animation-delay: .36s; }
.workspace-loading__note { margin: 0 0 25px; font-size: 11px; line-height: 1.6; color: var(--loading-muted); }
.workspace-loading__footer { margin: 0 -30px; padding: 18px 16px; border-top: 1px solid #e9edf2; color: #6d7885; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
@keyframes workspace-orbit-outer { from { transform: rotateX(58deg) rotateY(-18deg) rotateZ(0deg); } to { transform: rotateX(58deg) rotateY(-18deg) rotateZ(360deg); } }
@keyframes workspace-orbit-inner { from { transform: rotateX(-48deg) rotateY(34deg) rotateZ(360deg); } to { transform: rotateX(-48deg) rotateY(34deg) rotateZ(0deg); } }
@keyframes workspace-loading-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 480px) {
  .workspace-loading { padding: 20px; }
  .workspace-loading__card { padding: 25px 20px 0; border-radius: 20px; }
  .workspace-loading__footer { margin: 0 -20px; }
}
@media (max-height: 560px) {
  .workspace-loading { align-items: start; padding-block: 16px; }
  .workspace-loading__scene { margin-top: -8px; margin-bottom: -16px; transform: scale(.8); }
  .workspace-loading__card { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-loading__orbit, .workspace-loading__dots i { animation: none; }
  .workspace-loading__orbit--outer { transform: rotateX(58deg) rotateY(-18deg) rotateZ(25deg); }
  .workspace-loading__orbit--inner { transform: rotateX(-48deg) rotateY(34deg) rotateZ(-25deg); }
}

/* Navigation loading stays inside the content area; sidebar remains usable. */
.page-loading { position: sticky; top: 12px; z-index: 80; display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%; box-sizing: border-box; margin: 0 0 14px auto; padding: 12px 20px; color: #10273d; background: linear-gradient(135deg,#fff,#f2f5f9); border: 1px solid #dce3ec; border-radius: 14px; box-shadow: 0 8px 24px #10273d15; font-weight: 700; }
.page-loading__ring { flex: 0 0 auto; width: 26px; height: 26px; border: 4px solid #dce3ec; border-top-color: #ca362c; border-right-color: #10273d; border-radius: 50%; box-shadow: inset 0 1px 2px #fff,0 2px 3px #10273d26; animation: page-loading-turn 1s linear infinite; }
.page-load-error { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; margin-bottom: 16px; border: 1px solid #e6b6b0; border-radius: 10px; background: #fff3f1; color: #82251f; }
.page-loading[hidden], .page-load-error[hidden] { display: none; }
.tab[aria-busy="true"] { opacity: .65; }
.engineer-task-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; font-size: 13px; }
@keyframes page-loading-turn { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .page-load-error { flex-direction: column; align-items: flex-start; } .engineer-task-pagination { flex-wrap: wrap; } .engineer-task-pagination span { order: -1; width: 100%; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .page-loading__ring { animation: none; } }

/* Project controls scale by searching, not by duplicating thousands of options. */
input[data-project-lookup] { min-width: 0; }
.project-lookup-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#engineerProjectChart { max-height: 320px; overflow-y: auto; }
#engineerProjectChartNote { margin: 6px 0 0; font-size: 12px; }
.engineer-projects-dialog { width: min(720px, calc(100vw - 32px)); max-height: 88vh; box-sizing: border-box; }
.engineer-project-list-wrap { max-height: min(48vh, 420px); overflow: auto; margin-top: 16px; }
.engineer-project-list-wrap table { width: 100%; min-width: 0; }
.engineer-project-list-wrap th { position: sticky; top: 0; background: #f1f3f6; color: #10273d; }
.engineer-project-list-wrap td:first-child { overflow-wrap: anywhere; }
@media (max-width: 640px) { .engineer-chart-panel .panel-title { flex-wrap: wrap; gap: 12px; } .engineer-projects-dialog .dialog-card { padding: 16px; } }
