:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1f2d3d;
  background: linear-gradient(180deg, #f7f5f1 0%, #eef3f7 100%);
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(180deg, #f7f5f1 0%, #eef3f7 100%); }
button, input, select { font: inherit; }
input, select { width: 100%; border: 1px solid #d8dfec; border-radius: 10px; padding: 0.62rem 0.72rem; background: #fff; }
button { border: 1px solid #d6dde7; border-radius: 10px; padding: 0.78rem 0.95rem; background: #eef3f8; color: #2d3b45; cursor: pointer; }
button.primary { background: #dbe6ef; color: #233746; }
button.danger-button { background: #fff3f2; border-color: #f3c4be; color: #b42318; }
button.stage-button { width: 100%; background: #f5f8ff; border-color: #d8dfec; }
.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6dde7;
  border-radius: 10px;
  padding: 0.78rem 0.95rem;
  background: #eef3f8;
  color: #2d3b45;
  cursor: pointer;
  overflow: hidden;
}
.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.app-shell { width: 100%; max-width: 1660px; margin: 0 auto; padding: 14px 10px 24px; }
.panel, .panel-lite, .sheet-section { background: rgba(255,255,255,.96); border: 1px solid #dde6ef; border-radius: 18px; padding: 16px; box-shadow: 0 10px 24px rgba(42, 67, 92, 0.05); }
.topbar, .panel-head, .sheet-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.topbar-actions, .inline-actions, .compact-actions, .summary-strip, .bottom-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.topbar-actions > * { flex: 0 0 auto; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: #5c6b8a; }
h1, h2 { margin: 0; }
.subcopy, .compact-message { color: #5c6b8a; }
.fatal-error-box { white-space: pre-wrap; overflow-wrap: anywhere; background: #fff6f5; color: #7a271a; border: 1px solid #f1c2bd; border-radius: 12px; padding: 12px; margin-top: 12px; font-size: .9rem; }
.summary-strip { margin: 16px 0; padding: 8px 2px; color: #5c6b8a; font-weight: 600; }
.sheet-wrap, .table-wrap { overflow: auto; border: 1px solid #e1e7f2; }
.sheet-table, table { width: 100%; border-collapse: collapse; min-width: 100%; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #edf1f7; vertical-align: top; }
th { font-size: .92rem; text-transform: uppercase; letter-spacing: .04em; color: #62718d; background: #f5f8ff; }
.search { min-width: 320px; border: 1px solid #d8dfec; border-radius: 12px; padding: .85rem 1rem; font-size: .92rem; }
.bottom-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.summary-ai-box { border: 1px solid #dbe4ee; background: #f7fbff; border-radius: 14px; padding: 14px; text-align: left; }
.import-list { display: grid; gap: 10px; padding-left: 18px; margin: 12px 0 18px; }
.mapping-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #edf1f7; }
.stage-detail-row { display: grid; gap: 10px; padding: 14px 0; }
.stage-card-header { display: flex; justify-content: space-between; align-items: center; }
.supervisor-review-box, .stage-notes-box { display: grid; gap: 10px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); display: grid; place-items: center; padding: 20px; }
.modal-card { width: min(1100px, 100%); max-height: 90vh; overflow: auto; background: white; border-radius: 20px; padding: 20px; }
.frontline-console-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.registry-card, .frontline-preview-box { border: 1px solid #dbe4ee; background: #f8fbfd; padding: 1rem 1.1rem; border-radius: 12px; }
.source-map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.import-mapping-grid { margin-top: 10px; }
.source-map-row { display: grid; gap: 6px; margin-bottom: 12px; }
.status { margin-bottom: 18px; padding: 12px 14px; border-radius: 14px; }
.success { background: #e3f3e8; color: #245d39; }
.error { background: #f9e1e5; color: #7b2232; }
.warning-text { color: #9a6700; font-weight: 700; }
.danger-text { color: #b42318; font-weight: 700; }
@media (max-width: 900px) {
  .frontline-console-grid, .bottom-tools, .source-map-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar, .panel-head, .sheet-toolbar { flex-direction: column; }
  .search { min-width: 0; width: 100%; }
}
