:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #141827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar,
.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e2e7f0;
  box-shadow: 0 18px 48px rgba(46, 72, 118, 0.12);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 800;
  color: #667085;
}

.session-box,
.panel-head,
.actions-row,
.drop-actions,
.mode-row,
.filters,
.login-grid {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-box {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.grid {
  display: grid;
  grid-template-columns: minmax(300px, 390px) 1fr;
  gap: 18px;
}

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

.panel {
  border-radius: 16px;
  padding: 20px;
}

.panel-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.login-panel {
  margin-bottom: 18px;
}

.login-grid {
  flex-wrap: wrap;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #475467;
}

input,
select {
  min-height: 42px;
  border: 1px solid #d7deea;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: #141827;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.checkbox-line input {
  min-height: auto;
}

.btn,
.icon-btn,
.segment,
.mode,
.filter-toggle {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  background: #101828;
  color: #fff;
}

.btn.subtle,
.icon-btn,
.segment,
.mode {
  background: #eef2f7;
  color: #263348;
}

.btn:disabled,
.mode:disabled,
.segment:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn {
  width: 42px;
  padding: 0;
}

.segment.active,
.mode.active,
.filter-toggle.active {
  background: #dbeafe;
  color: #173b78;
}

.filters {
  align-items: stretch;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filters input {
  flex: 1;
  min-width: 0;
}

.filter-toggle {
  background: #eef2f7;
  color: #263348;
  white-space: nowrap;
}

.orders-list,
.unit-list,
.phase-list {
  display: grid;
  gap: 10px;
}

.order-card,
.unit-card,
.phase-row,
.detail-card,
.summary-card {
  border: 1px solid #e4e9f2;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}

.order-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.unit-card {
  width: 100%;
  text-align: center;
  cursor: pointer;
}

.order-card.active,
.unit-card.active {
  border-color: #84aef5;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(132, 174, 245, 0.24);
}

.order-card:focus-visible,
.unit-card:focus-visible {
  outline: 3px solid rgba(132, 174, 245, 0.55);
  outline-offset: 2px;
}

.order-name,
.unit-name {
  font-weight: 900;
  color: #101828;
}

.muted,
.order-meta,
.message {
  color: #667085;
}

.message {
  line-height: 1.45;
}

.message.small {
  font-size: 14px;
}

.message.error {
  color: #b42318;
  font-weight: 800;
}

.message.success {
  color: #047857;
  font-weight: 800;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  font-weight: 900;
  white-space: nowrap;
}

.chip.live {
  background: #dcfce7;
  color: #166534;
}

.chip.error {
  background: #fee4e2;
  color: #b42318;
}

.detail-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-card strong,
.summary-card strong {
  display: block;
  font-size: 24px;
  margin-top: 4px;
}

.dropzone {
  border: 2px dashed #b9cdf7;
  background: #f8fbff;
  border-radius: 16px;
  display: grid;
  gap: 8px;
  padding: 20px;
  margin-bottom: 14px;
}

.dropzone.dragover {
  border-color: #4477d6;
  background: #eef5ff;
}

.actions-row {
  justify-content: flex-end;
}

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

.phase-row.done {
  border-color: #bbf7d0;
}

.phase-row.active {
  border-color: #93c5fd;
}

.phase-row.error {
  border-color: #fecaca;
}

.progress {
  height: 10px;
  background: #e4e9f2;
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: #2563eb;
  transition: width 180ms ease;
}

.progress-meta {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(110px, 1fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
  color: #475467;
}

.progress-meta strong {
  color: #101828;
  font-size: 20px;
}

.progress-meta span {
  min-height: 32px;
  border: 1px solid #e4e9f2;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: #f8fafc;
  font-weight: 800;
}

@media (max-width: 920px) {
  .grid,
  .detail-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .progress-meta {
    grid-template-columns: 1fr;
  }

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

  .session-box {
    justify-content: flex-start;
  }
}
