/* Administration: tenant-scoped workspace, independently styled from service modules. */
.cfg-workspace { display: grid; gap: 24px; padding: 5px 0 36px; width: 100%; max-width: none; margin: 0; min-width: 0; --cfg-radius: 18px; }
.cfg-workspace [hidden] { display: none !important; }
.cfg-workspace .cfg-icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.cfg-workspace button { min-height: 39px; border-radius: 9px; font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .16s, border-color .16s, transform .16s, box-shadow .16s; }
.cfg-workspace button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 62%, var(--line)); box-shadow: 0 3px 12px #0000000c; }
.cfg-workspace button:active:not(:disabled) { transform: translateY(1px); }
.cfg-workspace :is(button,input,select,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cfg-workspace .primary { background: var(--accent); color: #062b22; border-color: transparent; font-weight: 750; padding: 10px 16px; }
.cfg-workspace .primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 85%, white); }
[data-theme="light"] .cfg-workspace .primary { color: #fff; }
.cfg-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 31px 34px; border: 1px solid color-mix(in srgb, var(--accent) 23%, var(--line)); border-radius: var(--cfg-radius); background: radial-gradient(ellipse at 92% 10%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 65%), linear-gradient(120deg, var(--surface), var(--surface-3)); position: relative; overflow: hidden; }
.cfg-kicker { display: block; color: var(--accent); font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: 1.5px; line-height: 1.5; }
.cfg-hero h2 { font-size: clamp(25px, 3vw, 36px); line-height: 1.2; margin: 8px 0 9px; letter-spacing: -1.15px; font-weight: 750; }
.cfg-hero h2 > span { color: var(--accent); }
.cfg-hero p { color: var(--muted); font-size: 14px; margin: 0; }
.cfg-hero-context { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 23px; }
.cfg-hero-context > span { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.cfg-hero-context > span:first-child { color: var(--text); font-weight: 650; }
.cfg-hero-context .cfg-icon { width: 15px; height: 15px; color: var(--accent); }
.cfg-hero-mark { display: flex; flex-shrink: 0; align-items: center; gap: 14px; padding: 20px 25px; background: color-mix(in srgb, var(--accent) 5%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 16px; color: var(--accent); }
.cfg-hero-mark .cfg-icon { width: 43px; height: 43px; stroke-width: 1.3; }
.cfg-hero-mark > span { font-size: 9px; letter-spacing: 2px; line-height: 1.8; }
.cfg-hero-mark b { font-size: 11px; letter-spacing: 1.5px; }
.cfg-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.cfg-metrics > button { padding: 21px 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; justify-content: flex-start; text-align: left; gap: 13px; min-width: 0; }
.cfg-metric-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); flex: 0 0 auto; }
.cfg-metric-icon.is-blue { color: #6ea8f7; background: #6ea8f714; }
.cfg-metric-icon.is-purple { color: #b391f2; background: #b391f214; }
.cfg-metric-icon.is-amber { color: var(--amber); background: color-mix(in srgb, var(--amber) 9%, transparent); }
.cfg-metrics small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 9px; line-height: 1.4; white-space: normal; }
.cfg-metrics b { display: flex; align-items: baseline; gap: 10px; font-size: 25px; line-height: 1; font-weight: 750; }
.cfg-metrics em { font-size: 10px; font-style: normal; font-weight: 450; color: var(--muted); }
.cfg-metrics i { font-size: 17px; font-style: normal; color: var(--muted); margin-left: auto; align-self: flex-start; }
.cfg-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); padding: 0 0 1px; overflow: auto; scrollbar-width: thin; }
.cfg-tabs > button { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); border-radius: 8px 8px 0 0; padding: 12px 17px 15px; min-height: 49px; white-space: nowrap; position: relative; }
.cfg-tabs > button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 5%, transparent); box-shadow: none; color: var(--text); }
.cfg-tabs > button.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cfg-tabs > button.is-active::after { content: ''; height: 2px; background: var(--accent); position: absolute; bottom: -1px; left: 15px; right: 15px; border-radius: 3px; }
.cfg-tabs .cfg-icon { width: 17px; height: 17px; }
.cfg-tab-content { min-width: 0; }
.cfg-panel { border: 1px solid var(--line); border-radius: var(--cfg-radius); background: var(--surface); min-width: 0; }
.cfg-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 25px 26px; }
.cfg-panel-heading .cfg-kicker { font-size: 9px; margin-bottom: 6px; }
.cfg-panel-heading h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.cfg-panel-heading p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 7px 0 0; }
.cfg-count { display: inline-flex; align-items: center; justify-content: center; padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; font-weight: 700; color: var(--muted); }
.cfg-toolbar { display: flex; align-items: center; gap: 12px; padding: 0 26px 22px; }
.cfg-toolbar > select { width: auto; min-width: 150px; height: 40px; margin: 0; padding: 9px 12px; font-size: 11px; border-radius: 9px; background: var(--surface-3); }
.cfg-search { display: flex !important; flex: 1; align-items: center; gap: 9px !important; background: var(--surface-3); border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; min-width: 160px; }
.cfg-search .cfg-icon { width: 17px; height: 17px; color: var(--muted); }
.cfg-search input { height: 40px; background: transparent; border: 0; border-radius: 9px; padding: 10px 0; font-size: 12px; min-width: 0; box-shadow: none; }
.cfg-search:focus-within { border-color: var(--accent); }
.cfg-search input:focus { outline: none; }
.cfg-table { border: none; border-radius: 0; overflow: visible; }
.cfg-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cfg-table th { background: var(--surface-3); color: var(--muted); font-weight: 650; font-size: 10px; letter-spacing: .5px; text-transform: uppercase; padding: 13px 19px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.cfg-table td { padding: 18px 19px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cfg-table tbody tr:last-child td { border-bottom: 0; }
.cfg-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 2%, transparent); }
.cfg-table td:first-child, .cfg-table th:first-child { padding-left: 26px; }
.cfg-table td:last-child, .cfg-table th:last-child { padding-right: 26px; }
.cfg-table .badge { white-space: normal; font-size: 10px; line-height: 1.5; font-weight: 650; max-width: 140px; padding: 4px 9px; }
.cfg-person { display: flex; align-items: center; gap: 11px; min-width: 175px; }
.cfg-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--accent) 7%, var(--surface-3)); color: var(--accent); font-size: 11px; font-weight: 750; }
.cfg-person > div { display: grid; gap: 4px; min-width: 0; }
.cfg-person b { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.cfg-person :is(span,small):not(.cfg-avatar) { color: var(--muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.cfg-person small { opacity: .8; }
.cfg-2fa { white-space: nowrap; color: var(--amber); font-size: 10px; }
.cfg-2fa.is-enabled { color: var(--accent); }
.cfg-modules-cell { max-width: 190px; }
.cfg-modules-cell > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.6; }
.cfg-row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cfg-row-actions > button { font-size: 10px; padding: 6px 9px; min-height: 31px; background: transparent; }
.cfg-action-menu { position: relative; }
.cfg-action-menu summary { list-style: none; cursor: pointer; border-radius: 7px; color: var(--muted); padding: 5px 9px; min-width: 31px; text-align: center; font-size: 11px; }
.cfg-action-menu summary::-webkit-details-marker { display: none; }
.cfg-action-menu summary:hover { background: var(--surface-2); }
.cfg-action-menu > div { display: grid; position: absolute; right: 0; top: calc(100% + 5px); z-index: 15; min-width: 205px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); border-radius: 11px; padding: 6px; }
.cfg-action-menu > div button { border: 0; justify-content: flex-start; font-size: 11px; padding: 8px 10px; min-height: 33px; background: transparent; white-space: nowrap; }
.cfg-action-menu > div button:hover { background: var(--surface-2); box-shadow: none; }
.cfg-action-menu .danger { color: var(--red); }
.cfg-menu-hint { border-top: 1px solid var(--line); font-size: 9px; color: var(--muted); padding: 10px 8px 5px; }
.cfg-panel-foot { display: flex; align-items: center; gap: 8px; padding: 15px 26px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); line-height: 1.5; }
.cfg-panel-foot .cfg-icon { width: 14px; height: 14px; color: var(--accent); }
.cfg-editor { margin: 0 26px 24px; padding: 23px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 13px; background: var(--surface-3); }
.cfg-editor .cfg-editor { margin: 0; }
.cfg-user-form { gap: 19px; }
.cfg-form-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.cfg-form-heading h3 { font-size: 18px; letter-spacing: -.3px; margin: 5px 0; }
.cfg-form-heading p { color: var(--muted); font-size: 11px; margin: 7px 0 3px; }
.cfg-workspace .cfg-close { background: transparent; border: 0; color: var(--muted); font-size: 23px; padding: 0 8px; min-height: 30px; }
.cfg-workspace label { font-size: 11px; font-weight: 600; color: var(--text); gap: 8px; }
.cfg-workspace input, .cfg-workspace select { min-height: 42px; border-radius: 8px; font-size: 12px; font-weight: 450; }
.cfg-workspace input::placeholder { color: var(--muted); font-weight: 400; }
.cfg-workspace .split { gap: 18px; }
.cfg-form-columns { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 18px; }
.cfg-role-guide { font-size: 11px; color: var(--muted); line-height: 1.7; padding-left: 11px; border-left: 2px solid var(--accent); }
.cfg-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 17px; }
.cfg-form-footer > span { font-size: 10px; line-height: 1.7; color: var(--muted); max-width: 440px; }
.cfg-workspace .actions { gap: 8px; }
.cfg-workspace .actions button { font-size: 11px; }
.cfg-lock-note, .cfg-access-info { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; background: color-mix(in srgb, var(--accent) 5%, var(--surface-3)); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: 10px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.cfg-lock-note .cfg-icon, .cfg-access-info > .cfg-icon { color: var(--accent); margin-top: 2px; }
.cfg-access-info { margin: 0 26px 24px; }
.cfg-access-info b { color: var(--text); font-size: 12px; }
.cfg-access-info p { margin: 4px 0 0; font-size: 11px; color: var(--muted); line-height: 1.7; }
.cfg-access-label { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 10px; line-height: 1.6; }
.cfg-access-label .cfg-icon { width: 15px; height: 15px; }
.cfg-feedback { border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); padding: 13px 17px; font-size: 12px; line-height: 1.6; }
.cfg-feedback.is-error, .cfg-form-error { color: var(--red); background: color-mix(in srgb, var(--red) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line)); border-radius: 9px; padding: 12px 15px; font-size: 12px; line-height: 1.6; }
.cfg-organization-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 20px; align-items: start; }
.cfg-corporations { display: grid; gap: 13px; padding: 0 26px 26px; }
.cfg-corporation { display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-3); }
.cfg-corporation.is-active { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, var(--surface-3)); }
.cfg-corp-symbol { display: grid; place-items: center; width: 43px; height: 45px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--accent); background: var(--surface); }
.cfg-corporation-copy { min-width: 0; }
.cfg-corporation-copy h3 { font-size: 14px; margin: 0 0 4px; overflow-wrap: anywhere; }
.cfg-corporation-copy > span { font-size: 11px; color: var(--muted); }
.cfg-corporation-copy > div { margin-top: 10px; display: flex; align-items: center; gap: 9px; }
.cfg-corporation-copy small { font-size: 9px; color: var(--accent); }
.cfg-corporation-actions { display: flex; flex-direction: column; gap: 6px; margin-left: auto; flex-shrink: 0; }
.cfg-corporation-actions button { font-size: 10px; min-height: 31px; padding: 6px 11px; background: transparent; }
.cfg-sector-form { padding: 0 26px 23px; }
.cfg-sector-form button { margin-top: 3px; }
.cfg-sectors { border-top: 1px solid var(--line); padding: 0 26px 10px; }
.cfg-sectors > article { display: flex; gap: 12px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cfg-sectors > article:last-child { border: 0; }
.cfg-sector-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 3px; flex-shrink: 0; }
.cfg-sectors article > div { display: grid; gap: 5px; }
.cfg-sectors b { font-size: 12px; }
.cfg-sectors small { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.cfg-permissions-list { display: grid; padding: 0 26px 13px; }
.cfg-permissions-list article { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(0, 1.5fr) auto; align-items: center; gap: 20px; padding: 19px 0; border-top: 1px solid var(--line); }
.cfg-permissions-list article > button { font-size: 10px; }
.cfg-permission-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-module-tag { display: inline-flex; color: var(--muted); background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 10px; line-height: 1.3; }
.cfg-module-tag.is-all { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cfg-permission-lock { color: var(--muted); }
.cfg-permission-lock .cfg-icon { width: 16px; }
.cfg-empty { padding: 35px 20px; text-align: center; font-size: 12px; line-height: 1.8; color: var(--muted); }
.cfg-activity-select { display: flex !important; align-items: center; gap: 12px !important; }
.cfg-activity-select select { min-width: 220px; }
.cfg-filter-hint { color: var(--muted); margin-left: auto; font-size: 11px; }
.cfg-date { white-space: nowrap; color: var(--muted); font-size: 11px; }
.cfg-load-more { padding: 17px; display: flex; justify-content: center; }
.cfg-workspace .module-access-box { margin: 0; padding: 18px; border-radius: 10px; background: var(--surface); }
.cfg-workspace .module-access-head { align-items: flex-start; gap: 9px; }
.cfg-workspace .module-access-head > span { font-size: 10px; line-height: 1.5; }
.cfg-workspace .module-access-head b { font-size: 12px; }
.cfg-workspace .module-access-mode { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.cfg-workspace .module-access-mode label { padding: 7px 12px; font-size: 11px; background: var(--surface-3); border-radius: 8px; }
.cfg-workspace .module-access-mode input { min-height: 0; }
.cfg-workspace .module-access-card { border-radius: 9px; padding: 13px; min-height: 62px; }
.cfg-workspace .module-access-copy b { font-size: 11px; }
.cfg-workspace .module-access-copy small { font-size: 9px; }
.cfg-workspace .module-access-summary { font-size: 10px; padding: 10px 12px; border-radius: 7px; }
@media (max-width: 1200px) {
  .cfg-metrics > button { padding: 17px 14px; gap: 10px; }
  .cfg-metrics b { display: grid; gap: 6px; }
  .cfg-table { overflow-x: auto; padding-bottom: 2px; }
  .cfg-table table { min-width: 860px; }
  .cfg-action-menu > div { position: fixed; top: auto; right: 35px; }
  .cfg-metrics small { font-size: 10px; }
  .cfg-metrics i { display: none; }
}
@media (max-width: 900px) {
  .cfg-workspace { gap: 18px; }
  .cfg-hero { padding: 25px; }
  .cfg-hero-mark { display: none; }
  .cfg-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .cfg-metrics b { display: flex; }
  .cfg-organization-grid { grid-template-columns: 1fr; }
  .cfg-permissions-list article { grid-template-columns: 1fr auto; gap: 13px; }
  .cfg-permission-tags { grid-column: 1 / -1; grid-row: 2; }
  .cfg-permissions-list article > button, .cfg-permission-lock { grid-column: 2; grid-row: 1; }
  .cfg-tabs > button { padding: 12px 13px; font-size: 12px; }
  .cfg-panel-heading { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .cfg-workspace { padding-top: 0; --cfg-radius: 13px; }
  .cfg-hero { padding: 22px 19px; }
  .cfg-hero-context { margin-top: 19px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .cfg-hero h2 { font-size: 27px; letter-spacing: -.8px; }
  .cfg-hero p { font-size: 12px; }
  .cfg-metrics > button { padding: 14px 11px; align-items: flex-start; }
  .cfg-metric-icon { width: 33px; height: 33px; border-radius: 9px; }
  .cfg-metric-icon .cfg-icon { width: 17px; height: 17px; }
  .cfg-metrics b { display: grid; font-size: 23px; gap: 7px; }
  .cfg-metrics small { font-size: 9px; min-height: 25px; margin-bottom: 4px; }
  .cfg-metrics em { font-size: 9px; }
  .cfg-tabs { margin: 0 -2px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cfg-tabs > button { padding: 11px; min-height: 45px; font-size: 11px; white-space: normal; justify-content: flex-start; text-align: left; }
  .cfg-tabs .cfg-icon { width: 15px; height: 15px; }
  .cfg-panel-heading { padding: 20px 17px; gap: 15px; }
  .cfg-panel-heading h2 { font-size: 18px; }
  .cfg-panel-heading p { font-size: 11px; }
  .cfg-panel-heading > .cfg-primary { width: 100%; }
  .cfg-toolbar { padding: 0 17px 19px; flex-wrap: wrap; gap: 8px; }
  .cfg-search { flex: 1 0 100%; }
  .cfg-toolbar > select { flex: 1; min-width: 0; font-size: 10px; }
  .cfg-editor { margin: 0 12px 20px; padding: 15px; }
  .cfg-workspace .split, .cfg-form-columns { grid-template-columns: 1fr; gap: 15px; }
  .cfg-form-footer { flex-direction: column; align-items: stretch; }
  .cfg-form-footer .actions { justify-content: flex-end; }
  .cfg-form-heading h3 { font-size: 16px; }
  .cfg-panel-foot { padding: 14px 17px; font-size: 9px; }
  .cfg-access-info { margin: 0 17px 20px; padding: 13px; }
  .cfg-access-info p { font-size: 10px; }
  .cfg-corporations { padding: 0 17px 19px; gap: 10px; }
  .cfg-corporation { padding: 13px; gap: 11px; flex-wrap: wrap; }
  .cfg-corporation-copy { flex: 1; }
  .cfg-corporation-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
  .cfg-corporation-copy h3 { font-size: 13px; }
  .cfg-sector-form { padding: 0 17px 20px; }
  .cfg-sectors { padding: 0 17px 8px; }
  .cfg-permissions-list { padding: 0 17px 12px; }
  .cfg-permissions-list .cfg-person { min-width: 0; }
  .cfg-permissions-list .cfg-person b { font-size: 11px; }
  .cfg-permissions-list .cfg-person span { font-size: 9px; }
  .cfg-permissions-list article { gap: 11px; }
  .cfg-permissions-list article > button { padding: 7px; font-size: 9px; min-height: 33px; }
  .cfg-activity-select { width: 100%; flex-direction: column; align-items: flex-start; }
  .cfg-activity-select select { width: 100%; min-width: 0; }
  .cfg-filter-hint { margin-left: 0; }
  .cfg-workspace .module-access-grid { grid-template-columns: 1fr; }
  .cfg-workspace .module-access-head { flex-direction: column; }
  .cfg-workspace .module-access-mode label { padding: 7px 8px; font-size: 9px; }
  .cfg-workspace .module-access-box { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { .cfg-workspace button { transition: none; } }
