/* Productized org/user UI demo styles, aligned with h5-common.css */
.demo-app {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 18px);
}

.demo-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.role-entry {
  margin-top: 16px;
  border-top: 1px solid #e6ebf0;
  padding-top: 14px;
}

.role-entry-title {
  color: #5b6b7c;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 8px;
}

.role-entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.role-entry-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #d7e0ea;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.role-entry-link span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.head-action-row {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.metric-box b {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.metric-box span {
  display: block;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}

.tabs,
.role-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.role-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tab-btn,
.role-btn {
  min-height: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.tab-btn.active,
.role-btn.active {
  background: var(--soft);
  border-color: var(--primary);
  color: var(--primary);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 5px;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notice {
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: #fff7ed;
  color: #9a3412;
  padding: 10px;
  font-size: 13px;
}

.success-panel {
  display: none;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  background: #f0fdf4;
  padding: 12px;
}

.success-panel.show {
  display: block;
}

.success-title {
  color: #137044;
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 6px;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.action-row .btn,
.action-row button {
  flex: 1 1 128px;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-card,
.org-card,
.person-card,
.task-card,
.training-card,
.flow-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.user-head,
.org-head,
.person-head,
.task-head,
.training-head,
.flow-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--primary);
  font-weight: 900;
  flex-shrink: 0;
}

.user-main,
.org-main,
.person-main,
.task-main,
.training-main,
.flow-main {
  min-width: 0;
  flex: 1;
}

.screen-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.progress-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.progress-step {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  padding: 5px;
}

.progress-step.active {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary);
}

.field-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.field-preview b {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.result-score {
  color: var(--primary);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  min-width: 62px;
  text-align: right;
}

.status-dot {
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  background: var(--primary);
}

.status-dot.pending {
  background: #f59e0b;
}

.status-dot.active {
  background: #16a34a;
}

.status-dot.disabled {
  background: #94a3b8;
}

.row-link {
  color: var(--secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(18,32,45,.08);
  padding: 7px 18px calc(env(safe-area-inset-bottom) + 7px);
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  min-height: 50px;
  padding: 6px 8px;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.nav-btn.active {
  background: var(--soft);
  color: var(--primary);
}

.sheet-mask {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  background: rgba(23,33,43,.46);
  z-index: 60;
}

.sheet-mask.show {
  display: flex;
}

.sheet-panel {
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px 12px 0 0;
  padding: 14px 14px calc(env(safe-area-inset-bottom) + 14px);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.sheet-title {
  font-weight: 900;
  font-size: 17px;
}

.manager-demo-main {
  padding-bottom: calc(env(safe-area-inset-bottom) + 82px);
}

.role-workbench {
  padding-bottom: calc(env(safe-area-inset-bottom) + 82px);
}

@media (min-width: 720px) {
  .demo-app {
    max-width: 560px;
    margin: 0 auto;
  }
}

@media (max-width: 420px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .inline-fields {
    grid-template-columns: 1fr;
  }
}
