html[data-surface="staff"] .sidebar,
html[data-surface="staff"] .mobile-nav,
html[data-surface="staff"] .page-header,
html[data-surface="staff"] main > footer { display: none; }
.staff-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) max(24px, calc((100vw - 1100px) / 2)) 18px;
  background: #17382e;
  color: #fff;
}
.staff-header h1 { font-size: 17px; letter-spacing: 0; margin: 0; }
.staff-header button { background: #ffffff16; border-color: #ffffff35; color: #fff; font-weight: 600; }
html[data-surface="staff"] .staff-header button:hover { background: #ffffff28; }
html[data-surface="staff"] main { margin: 0 auto; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); max-width: 1148px; }
.staff-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--app-border-subtle, #edf2ee);
  background: #fff;
  box-shadow: 0 -2px 10px rgba(15, 56, 46, 0.03);
  padding: 6px 16px calc(6px + env(safe-area-inset-bottom));
}
.staff-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 1 1 0; min-width: 0; padding-left: 2px; padding-right: 2px; white-space: nowrap; max-width: 220px; min-height: 54px; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
.staff-tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.staff-tabs .active { color: var(--app-primary); font-weight: 600; }
#staff-settings-section { max-width: 640px; margin: auto; padding: 4px 0 24px; }
#staff-settings-section h2 { font-size: 17px; }
.settings-label { color: var(--app-muted, #6c7c74); font-size: 13px; font-weight: 600; margin: 20px 0 10px; }
.settings-group { border: 0; border-radius: var(--app-radius); background: #fff; box-shadow: var(--app-shadow-sm, 0 1px 4px rgba(15, 56, 46, 0.04)); overflow: hidden; }
.settings-group button, .settings-group a, .account-row { padding: 18px 16px; display: flex; gap: 13px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--app-border-subtle, #edf2ee); background: #fff; font-weight: 500; color: var(--text); text-decoration: none; }
.settings-group > :last-child { border-bottom: 0; }
.settings-group small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.settings-symbol { display: grid; place-items: center; background: var(--app-soft, #eef6f1); border-radius: 12px; width: 40px; height: 40px; color: var(--primary); font-size: 17px; flex-shrink: 0; }
.chevron { margin-left: auto; color: #9bb09b; font-size: 24px; }
.settings-group .danger { color: #a65846; }
@media (max-width: 600px) {
  .staff-header { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; gap: 8px; }
  .staff-header h1 { font-size: 17px; }
  .staff-header button { padding: 9px 10px; font-size: 12px; white-space: nowrap; }
  html[data-surface="staff"] main { padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
  .settings-group button, .settings-group a, .account-row { padding: 17px 16px; gap: 12px; font-size: 14px; }
  .settings-symbol { width: 36px; height: 36px; }
}

html[data-surface="staff"] .member-list { display: grid; gap: 14px; }
html[data-surface="staff"] .flow-symbol { background: #eaf3e8; }
html[data-surface="staff"] #admin-section h2 { overflow-wrap: anywhere; }
html[data-surface="staff"] #admin-section .admin-toolbar { flex-wrap: wrap; }

#staff-back { font-size: 24px; min-width: 44px; width: 44px; height: 44px; padding: 0; border: 0; display: flex; align-items: center; justify-content: center; background: transparent; }
#staff-title { flex: 1; font-weight: 600; }
html[data-surface="staff"] .staff-header:has(#staff-back:not([hidden])) { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; padding: 8px 16px; }
html[data-surface="staff"] .staff-header:has(#staff-save-password:not([hidden])) { grid-template-columns: 78px minmax(0, 1fr) 78px; padding: 8px 16px; }
html[data-surface="staff"] .staff-header:has(#staff-back:not([hidden])) #staff-title { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-account { margin-top: 16px; }
#password-form { background: white; padding: 20px; border: 0; border-radius: var(--app-radius); box-shadow: var(--app-shadow-sm, 0 1px 4px rgba(15, 56, 46, 0.04)); }
#password-form input { background: var(--app-input-bg, #eef3f0); border: 1px solid transparent; border-radius: 10px; min-height: 44px; }
#password-form input:focus { background: #fff; border-color: var(--app-primary); outline: none; }
.staff-tabs[hidden] { display: none; }


html[data-surface="staff"][data-app-tab="work"] #staff-title { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

.settings-current-account { margin: 16px 12px 0; color: #8a918e; font-size: 12px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; }

/* 代理商内页提供自己的顶栏，内容容器从屏幕顶部开始。 */
html[data-surface="staff"][data-app-tab="agents"] .staff-header { display:none !important; }

html[data-surface="staff"][data-account-page="true"] .staff-header { display:none !important; }

html[data-surface="staff"][data-app-tab="medical"] #staff-title { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }


/* 顶栏业务标签与品牌背景共用，不占用额外卡片空间。 */
html[data-surface="staff"][data-app-tab="inventory"] .staff-header { display:none !important; }
#medical-views .medical-tab-count { font-size:12px; line-height:20px; padding:0; color:inherit; font-variant-numeric:tabular-nums; }
#medical-views .medical-tab-count[hidden] { display:none; }

html[data-surface="staff"] .staff-header { box-sizing:border-box; min-height:60px; padding:8px 68px 8px 16px; }
#global-messages[hidden] { display:none; }
#global-messages small { position:absolute; top:1px; right:0; min-width:15px; height:15px; padding:0 3px; border-radius:10px; background:#c84334; color:#fff; font-size:10px; line-height:15px; }


html[data-surface="staff"] .staff-header { padding-right:112px; }
html[data-surface="staff"] .staff-header button[hidden] { display:none; }
html[data-surface="staff"] .staff-header button:hover { background:transparent; }
html[data-surface="staff"] .staff-header button .ui-icon { width:24px; height:24px; }

html[data-embedded-detail="true"] .staff-tabs,
html[data-embedded-detail="true"] #global-messages { display:none; }
html[data-surface="staff"] .staff-tabs button:hover{background:transparent}
/* Keep fixed host controls above embedded WebView surfaces during repaint. */
html[data-surface="staff"] :is(.staff-tabs,#global-messages){transform:translateZ(0);backface-visibility:hidden}

/* Global action geometry is also consumed by both embedded business channels. */
.staff-tabs .nav-icon-solid{display:none}
.staff-tabs .active .nav-icon-outline{display:none}
.staff-tabs .active .nav-icon-solid{display:inline}
html[data-surface="staff"] #global-messages,
html[data-surface="staff"] .staff-header :is(#staff-medical-add,#staff-new-task,#staff-new-flow){position:fixed;z-index:60;color:#fff;display:flex;align-items:center;justify-content:center;box-sizing:border-box;top:var(--app-header-action-top);right:var(--app-header-action-right);width:var(--app-header-action-size);min-width:var(--app-header-action-size);height:var(--app-header-action-size);min-height:var(--app-header-action-size);margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent;transform:translateZ(0)}
html[data-surface="staff"][data-has-add="true"] #global-messages{right:calc(var(--app-header-action-right) + var(--app-header-action-size))}
html[data-surface="staff"] #global-messages svg,
html[data-surface="staff"] .staff-header :is(#staff-medical-add,#staff-new-task,#staff-new-flow) .ui-icon{display:block;width:var(--app-header-icon-size);height:var(--app-header-icon-size)}
html[data-surface="staff"] #global-messages[hidden],
html[data-surface="staff"] .staff-header button[hidden]{display:none}
html[data-surface="staff"][data-embedded-detail="true"] #global-messages{display:none}
html[data-embedded-form="true"] #global-messages,html[data-form-page="true"] #global-messages{display:none!important}

#app-pull-refresh:not([hidden]) {
  position: fixed;
  z-index: 80;
  top: calc(env(safe-area-inset-top) + 64px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 1px solid #dbe6df;
  border-radius: 999px;
  background: #fff;
  color: #17382e;
  box-shadow: 0 4px 16px #17382e26;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}

@media (min-width: 1024px) {
  html[data-surface="staff"] {
    --staff-shell-inset: max(0px, calc((100% - 960px) / 2));
    background: #e7ede9;
  }

  html[data-surface="staff"] #workspace {
    width: 960px;
    margin-inline: auto;
    min-height: 100dvh;
    background: var(--app-bg, #f5f7f4);
    box-shadow: 0 0 24px #17382e14;
  }

  html[data-surface="staff"] :is(.staff-tabs, .form-page) {
    inset-inline: var(--staff-shell-inset);
  }

  html[data-surface="staff"] dialog.message-center {
    inset-inline: var(--staff-shell-inset);
    width: 960px;
  }

  html[data-surface="staff"] :is(#global-messages, .staff-header #staff-medical-add, .staff-header #staff-new-task, .staff-header #staff-new-flow) {
    right: calc(var(--staff-shell-inset) + var(--app-header-action-right));
  }

  html[data-surface="staff"][data-has-add="true"] #global-messages {
    right: calc(var(--staff-shell-inset) + var(--app-header-action-right) + var(--app-header-action-size));
  }
}
