/* Shared control contract for the active CRM workspaces. Load after local styles. */
.pc-workspace input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range],[type=color],[type=button],[type=submit]),
.pc-workspace select:not([multiple]){
 box-sizing:border-box;width:100%;min-width:0;height:var(--pc-control-height, 44px);min-height:var(--pc-control-height, 44px);max-height:var(--pc-control-height, 44px);
 padding:10px var(--pc-space-12);font-family:var(--pc-font-body);font-size:var(--pc-type-body-medium);font-weight:var(--pc-weight-regular);line-height:var(--pc-control-line-height, 20px);
 color:var(--pc-color-ink);background:#fff;border:1px solid var(--pc-control-border, #8c8c8c);border-radius:var(--pc-radius-control);margin-block:0;
}
.pc-workspace textarea{box-sizing:border-box;width:100%;min-width:0;height:var(--pc-textarea-height, 96px);min-height:var(--pc-textarea-height, 96px);padding:var(--pc-space-12);font-family:var(--pc-font-body);font-size:var(--pc-type-body-medium);line-height:var(--pc-control-line-height, 20px);font-weight:var(--pc-weight-regular);color:var(--pc-color-ink);border:1px solid var(--pc-control-border, #8c8c8c);border-radius:var(--pc-radius-control);background:#fff;resize:vertical;margin-block:0}
.pc-workspace :is(input[type=checkbox],input[type=radio]){box-sizing:border-box;width:var(--pc-check-size, 18px);height:var(--pc-check-size, 18px);min-height:var(--pc-check-size, 18px);flex:none;accent-color:var(--pc-color-ink);margin:2px 0 0}
.pc-workspace :is(.rr-check,.nc-check,.wf-check,.pk-check,.quest-selfcheck>label){display:flex;align-items:flex-start;gap:var(--pc-space-12);line-height:1.6}
.pc-workspace :is(.search-field,.mr-analyzer-toolbar>.search-field,.ops-task-filters>.search-field,.wf-sales-toolbar>.search-field,.wf-calls-toolbar>.search-field){box-sizing:border-box;height:var(--pc-control-height, 44px);min-height:var(--pc-control-height, 44px);max-height:var(--pc-control-height, 44px);padding:0 var(--pc-space-12);gap:var(--pc-space-8);align-items:center;max-width:none;border:1px solid var(--pc-control-border, #8c8c8c);border-radius:var(--pc-radius-control);background:#fff}
.pc-workspace .search-field input{box-sizing:border-box;height:calc(var(--pc-control-height, 44px) - 2px);min-height:calc(var(--pc-control-height, 44px) - 2px);max-height:calc(var(--pc-control-height, 44px) - 2px);padding:0;line-height:var(--pc-control-line-height, 20px);border:0;border-radius:0;background:transparent;outline:none;box-shadow:none}
.pc-workspace .search-field .ui-icon{flex:none}
.pc-workspace :is(input,select,textarea):focus-visible{outline:2px solid var(--pc-color-ink);outline-offset:2px}
.pc-workspace .search-field:focus-within{outline:2px solid var(--pc-color-ink);outline-offset:2px}
.pc-workspace .search-field input:focus-visible{outline:none}
.pc-workspace :is(input,select,textarea)[aria-invalid=true]{border-color:var(--pc-color-danger-text)}
.pc-workspace :is(input,select,textarea):disabled{color:var(--pc-color-muted);cursor:not-allowed}
.pc-workspace :is(.rr-fields,.net-form-grid,.wf-form-grid,.pk-form-grid,.finish-fields){gap:var(--pc-form-column-gap, 24px);align-items:start}
.pc-workspace :is(.rr-fields,.net-form-grid,.wf-form-grid,.pk-form-grid,.finish-fields)>label:has(textarea){grid-column:1/-1}
.pc-workspace :is(.rr-form,.net-form,.finish-form,.wf-editor,.pk-form-grid) label:not(:has(input[type=checkbox],input[type=radio])){gap:var(--pc-field-label-gap, 8px);align-content:start}
.pc-workspace :is(.button,.text-button,.net-text-link){min-height:var(--pc-control-height, 44px);align-items:center}
.pc-workspace .text-button{display:inline-flex;justify-content:center;gap:var(--pc-space-8)}
.pc-workspace :is(.nav-link,.role-switch button,.review-header button){min-height:var(--pc-control-height, 44px)}
.pc-workspace #rr-settings-form .rr-fields{grid-template-columns:minmax(160px,.65fr) repeat(2,minmax(0,1fr))}
.pc-workspace #rr-settings-form [name=reason]{height:var(--pc-textarea-height, 96px);min-height:var(--pc-textarea-height, 96px)}
.pc-workspace :is(.rr-form,.net-form,.finish-form) [role=status]:empty{display:none}
.pc-workspace .pc-skip-link{position:fixed;z-index:100;left:16px;top:8px;padding:12px 16px;background:#171717;color:#fff;border-radius:var(--pc-radius-control);transform:translateY(-160%);text-decoration:none}
.pc-workspace .pc-skip-link:focus{transform:none;outline:2px solid #fff;outline-offset:2px}
@media(max-width:1000px){.pc-workspace #rr-settings-form .rr-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.pc-workspace #rr-settings-form .rr-fields>label:has([name=dealTarget]){grid-column:1/-1}}
@media(max-width:680px){.pc-workspace :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range],[type=color]),select,textarea){font-size:16px}.pc-workspace :is(.rr-fields,.net-form-grid,.wf-form-grid,.pk-form-grid,.finish-fields){gap:var(--pc-space-16)}.pc-workspace #rr-settings-form .rr-fields{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.pc-workspace .pc-skip-link{scroll-behavior:auto}}

.pc-workspace :is(input,textarea)::placeholder{color:var(--pc-color-muted);opacity:1}

/* Feedback occupies space only when it has content. */
.pc-workspace :is(.wf-inline-error,[data-op-error],[data-error-for]):empty{display:none}
.pc-workspace #requisites-audit{margin-top:var(--pc-space-24)}
.pc-workspace .mr-header-actions>.button{align-self:flex-end}
.pc-workspace input[type=file]{box-sizing:border-box;width:100%;min-width:0;height:var(--pc-control-height, 44px);min-height:var(--pc-control-height, 44px);padding:7px var(--pc-space-8);font:400 12px/20px var(--pc-font-body);border:1px solid var(--pc-control-border, #8c8c8c);border-radius:var(--pc-radius-control);background:#fff}
.pc-workspace input[type=file]::file-selector-button{font:inherit;margin-right:var(--pc-space-12)}
@media(max-width:680px){.pc-workspace .ops-settings-section .section-head{flex-wrap:wrap;gap:var(--pc-space-12)}.pc-workspace .ops-settings-section .section-head>h2{flex-basis:100%}}

/* Boot assembles legacy extensions before revealing their final layout. */
.pc-workspace-loading .pc-workspace .app-shell{visibility:hidden}

/* Action buttons are text-only across every role. Cards and quiz answers keep their semantic surfaces. */
body.pc-workspace :is(.button,.text-button,.net-text-link,.wf-back,.net-auth button){display:inline-flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;min-height:44px;height:auto;max-width:100%;padding:10px 0;border:0!important;border-radius:0;background:transparent!important;background-image:none!important;box-shadow:none!important;color:var(--pc-color-ink,#171717)!important;font-family:var(--pc-font-body,Inter,sans-serif);font-size:14px;font-weight:600;line-height:20px;text-decoration:none;white-space:normal;cursor:pointer;vertical-align:middle;transition:color 120ms ease-out,opacity 120ms ease-out;transform:none}
body.pc-workspace :is(.button,.text-button,.net-text-link,.wf-back):hover:not(:disabled){background:transparent!important;text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px;transform:none}
body.pc-workspace :is(.button,.text-button,.net-text-link,.wf-back):focus-visible{outline:2px solid #171717;outline-offset:4px}
body.pc-workspace :is(.button,.text-button,.net-text-link,.wf-back):disabled{color:#595959!important;opacity:.5;cursor:not-allowed;text-decoration:none}
body.pc-workspace :is(.icon-button,.net-icon-button,.wf-icon-button,.ops-icon-action,.reward-add,.shop-item-add,.store-buy){background:transparent!important;box-shadow:none!important;color:#171717;border:0}
body.pc-workspace :is(.role-switch button,.review-header button,.nc-tabs>a,.nc-inline-filters>button,.rr-tabs button,.ops-segmented span){background:transparent!important;color:#171717!important;box-shadow:none!important}
body.pc-workspace :is(.role-switch button[aria-pressed=true],.review-header button[aria-pressed=true],.nc-tabs>a[aria-current=page],.nc-inline-filters>button[aria-pressed=true],.rr-tabs button[aria-pressed=true],.ops-segmented input:checked+span){font-weight:600;text-decoration:underline;text-underline-offset:7px;text-decoration-thickness:2px}
body.pc-workspace :is(.topbar,.breadcrumbs,.review-context,.page-head>.eyebrow,.page-head>div>.eyebrow){display:none!important}
body.pc-workspace :is(.data-table,.net-table,.rr-table){border-top:0!important}
body.pc-workspace :is(.data-table,.net-table,.rr-table) thead :is(tr,th){border-top:0!important}
body.pc-workspace :is(.wf-field,.pk-field,.grade-rule-card label,.shop-create-grid label,.shop-editor-settings label,.manager-admin-form label){display:grid;gap:8px;min-width:0;font-size:14px;line-height:20px;align-content:start}
body.pc-workspace :is(.wf-form-grid,.pk-form-grid,.rr-fields,.net-form-grid,.shop-create-grid,.shop-editor-settings){gap:var(--pc-work-section-gap);align-items:start}
body.pc-workspace .grade-rule-card{display:grid;gap:24px;align-content:start;padding:24px}
body.pc-workspace .grade-rule-card>label{margin:0}
body.pc-workspace input[type=file]::file-selector-button{border:0;background:transparent;color:#171717;padding:0 8px 0 0;min-height:28px;font-weight:600;cursor:pointer}
body.pc-workspace .pc-profile-open{display:flex;align-items:center;gap:12px;width:100%;text-align:left;min-height:52px;padding:12px 0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;text-decoration:none}
body.pc-workspace .pc-profile-open:hover strong{text-decoration:underline;text-underline-offset:4px}
body.pc-workspace .pc-profile-open:focus-visible{outline:2px solid #171717;outline-offset:4px}
body.pc-workspace .pc-profile-mobile{display:none}
body.pc-workspace .pc-account-section{margin-top:24px;max-width:none}
body.pc-workspace .pc-account-section h2{margin:0 0 16px}
body.pc-workspace .pc-account-facts{display:grid;gap:16px;margin:24px 0 0}
body.pc-workspace .pc-account-facts>div{display:grid;grid-template-columns:160px minmax(0,1fr);gap:24px;font-size:14px;line-height:1.6}
body.pc-workspace .pc-account-facts dt{color:#595959}
body.pc-workspace .pc-account-facts dd{margin:0;overflow-wrap:anywhere}
@media(max-width:760px){body.pc-workspace .sidebar{position:relative}body.pc-workspace .pc-profile-mobile{position:absolute;right:16px;top:8px;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;background:transparent;color:#171717;cursor:pointer}body.pc-workspace .pc-account-facts>div{grid-template-columns:1fr;gap:4px}}
@media(max-width:680px){body.pc-workspace .grade-rule-card{padding:var(--pc-work-panel-padding)}}

body.pc-workspace :is(.wf-form-actions,.pk-form-actions,.grade-rules-footer>div,.net-actions,.net-dialog-actions){gap:24px}
body.pc-workspace .grade-rule-card legend{font-size:12px;line-height:20px;font-weight:600}
@media(max-width:760px){body.pc-workspace .app-shell{align-content:start}}
@media(min-width:681px) and (max-width:760px){body.pc-workspace[data-ops-role] .pc-profile-mobile{display:none}}

body.pc-workspace .store-buy{width:44px;height:44px;min-height:44px;display:grid;place-items:center;flex:none}

body.pc-workspace :is(.wf-chips,.pk-filter-tabs,.pk-tabs,.pk-queue-tabs,.pk-filters) button{background:transparent!important;color:#171717!important;border:0;box-shadow:none}
body.pc-workspace :is(.wf-chips,.pk-filter-tabs,.pk-tabs,.pk-queue-tabs,.pk-filters) button[aria-pressed=true]{font-weight:600;text-decoration:underline;text-underline-offset:7px;text-decoration-thickness:2px}

/* Startup recovery is explicit; never silently discard saved records. */
.pc-startup-failure{max-width:640px;width:calc(100% - 32px);padding:32px;border:1px solid var(--pc-color-line,#ddd);border-radius:16px;background:#fff;color:#171717}
.pc-startup-failure::backdrop{background:rgba(0,0,0,.2)}
.pc-startup-failure h1{font-family:Unbounded,sans-serif;font-size:24px;line-height:1.4;margin:0 0 16px}
.pc-startup-failure p{font-family:Inter,sans-serif;font-size:16px;line-height:1.6;margin:0 0 24px}
.pc-startup-actions{display:flex;gap:16px 24px;flex-wrap:wrap}

/* Workspace spacing keeps the existing columns and component shapes. */
.pc-workspace :is(.overview-grid, .bento-row, .statistics-grid, .rr-grid, .nc-grid, .nc-metric-grid, .nc-branch-grid, .net-bento, .rop-kpi-grid, .call-view-grid, .payroll-grid, .pk-work-grid, .ops-analytics-grid) {
  gap: var(--pc-work-card-gap);
}
.pc-workspace .view[data-role-view] > :is(.page-head, .view-intro, .panel, .stat-strip, .overview-grid, .bento-row, .team-league-overview, .statistics-grid, .ops-profile-tasks, .rr-grid, .manager-top-grid, .manager-bottom-grid, .rop-kpi-grid, .call-view-grid, .payroll-grid) {
  margin-block: 0;
}
.pc-workspace .view[data-role-view] > :is(.page-head, .view-intro, .panel, .stat-strip, .overview-grid, .bento-row, .team-league-overview, .statistics-grid, .ops-profile-tasks, .rr-grid, .manager-top-grid, .manager-bottom-grid, .rop-kpi-grid, .call-view-grid, .payroll-grid):not([hidden])
  ~ :is(.page-head, .view-intro, .panel, .stat-strip, .overview-grid, .bento-row, .team-league-overview, .statistics-grid, .ops-profile-tasks, .rr-grid, .manager-top-grid, .manager-bottom-grid, .rop-kpi-grid, .call-view-grid, .payroll-grid):not([hidden]) {
  margin-block-start: var(--pc-work-section-gap);
}
.pc-workspace #manager-profile-kpis {
  gap: var(--pc-work-card-gap);
  border-block: 0;
}
.pc-workspace .manager-profile-tools {
  display: grid;
  gap: var(--pc-space-12);
  min-width: 0;
}
.pc-workspace .profile-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--pc-work-card-gap);
}
body.pc-workspace .view[data-role-view] .panel {
  padding: var(--pc-work-panel-padding);
}
.pc-workspace .view[data-role-view] :is(.statistics-grid, .stats-chart-grid, .manager-top-grid, .manager-bottom-grid, .requisites-summary-grid, .wf-detail-grid, .wf-call-layout) {
  gap: var(--pc-work-card-gap);
}
.pc-workspace .view[data-role-view] :is(.form-grid, .pk-form-grid, .wf-form-grid, .profile-edit-grid) {
  gap: var(--pc-work-section-gap);
}
.pc-workspace #network-content {
  display: flow-root;
  padding-block-start: var(--pc-space-32);
}
.pc-workspace #network-content > :is(.net-head, .net-panel, .nc-grid, .nc-scope, .nc-metric-grid, .nc-branch-grid, .nc-detail-period, .nc-inline-filters, .nc-tabs, .nc-form, .net-form, .nc-source-notice, .net-bento) {
  margin-block: 0;
}
.pc-workspace #network-content > :is(.net-head, .net-panel, .nc-grid, .nc-scope, .nc-metric-grid, .nc-branch-grid, .nc-detail-period, .nc-inline-filters, .nc-tabs, .nc-form, .net-form, .nc-source-notice, .net-bento):not([hidden])
  ~ :is(.net-head, .net-panel, .nc-grid, .nc-scope, .nc-metric-grid, .nc-branch-grid, .nc-detail-period, .nc-inline-filters, .nc-tabs, .nc-form, .net-form, .nc-source-notice, .net-bento):not([hidden]) {
  margin-block-start: var(--pc-work-section-gap);
}
.pc-workspace #network-content :is(.net-head, .nc-scope, .nc-inline-actions) {
  gap: var(--pc-work-card-gap);
}
.pc-workspace #network-content :is(.net-panel, .nc-metric, .nc-branch) {
  padding: var(--pc-work-panel-padding);
}
.pc-workspace #network-content .nc-grid .net-panel > .net-panel {
  padding: 0;
}
.pc-workspace #network-content .net-form {
  gap: var(--pc-work-section-gap);
  padding-block-start: 0;
}
.pc-workspace #network-content .net-form > .net-panel {
  display: grid;
  gap: var(--pc-work-section-gap);
}
.pc-workspace #network-content .net-form > .net-panel > :is(label, p, .net-section-head) {
  margin-block: 0;
}
.pc-workspace .nc-staff-branches {
  display: grid;
  gap: var(--pc-work-section-gap);
  min-width: 0;
}
.pc-workspace .nc-staff-branches > section + section {
  border-block-start: 1px solid var(--pc-color-line);
  padding-block-start: var(--pc-work-section-gap);
}
.pc-workspace .nc-staff-branches :is(h3, p) {
  margin-block: 0;
}
.pc-workspace .nc-staff-branches .net-section-head {
  gap: var(--pc-work-card-gap);
  flex-wrap: wrap;
}
.pc-workspace .nc-task-list {
  margin-block-start: var(--pc-space-12);
}
.pc-workspace .nc-task-list .nc-action-row > span:first-child {
  display: grid;
  gap: var(--pc-space-4);
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.pc-workspace .nc-task-list small,
.pc-workspace .ops-picker-task small {
  color: var(--pc-color-muted);
}
.pc-workspace .ops-picker-task {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--pc-work-card-gap);
  padding-block: var(--pc-work-card-gap);
  border-block-end: 1px solid var(--pc-color-line);
  overflow-wrap: anywhere;
}
.pc-workspace .ops-picker-task p {
  white-space: pre-wrap;
  margin-block: var(--pc-space-4);
}
@media (max-width: 760px) {
  .pc-workspace #network-content { padding-block-start: var(--pc-space-24); }
}
.pc-startup-actions button{font:600 14px/1.5 Inter,sans-serif;min-height:44px;padding:8px 0;background:transparent;color:inherit;border:0;cursor:pointer}
.pc-startup-actions button:focus-visible{outline:2px solid currentColor;outline-offset:4px}
