#admin-dialog {
    position: fixed;
    top: 20px;
    right: 0;
    bottom: auto;
    left: 0;
    max-height: none;
    margin: 0 auto;
    width: min(1040px, calc(100vw - 40px));
    max-width: none;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: #fff;
    color: var(--ink-900);
    box-shadow: 0 28px 80px rgba(20, 42, 33, 0.22);
    overflow: hidden;
}

#admin-dialog::backdrop {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.admin-shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0 auto;
    overflow: hidden;
}

.admin-header {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 0;
    background: transparent;
}
.admin-header::before {
    content: "";
    position: absolute;
    inset: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(115deg, #f2fbf7 0%, #fffefb 55%, #edf5ff 100%);
    z-index: -1;
}

.admin-header h2,
.admin-section-heading h3 {
    margin: 0;
    color: var(--ink-900);
}

.admin-header-title { display: flex; align-items: center; gap: 14px; min-width: 0; }

#admin-dialog #close-admin-dialog { display: grid; place-items: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; line-height: 1; border-radius: 10px; flex: none; }
#admin-dialog #close-admin-dialog svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.admin-followup-unread-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #9254c8; vertical-align: middle; }

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-window-button { display: grid; place-items: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #686871; cursor: pointer; flex: none; }
.admin-window-button:hover { background: #f2eafa; color: #673899; }
.admin-window-button svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.admin-window-button[hidden] { display: none; }
#admin-dialog .floating-resize { z-index: 3; }
.admin-history-controls { display: flex; align-items: center; gap: 4px; margin-right: 6px; }
.admin-history-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #686871; cursor: pointer; }
.admin-history-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.admin-history-button:hover:not(:disabled) { background: rgb(126 82 184 / 10%); color: #7850b5; }
.admin-history-button:focus-visible { outline: 2px solid #8f5dcb; outline-offset: 2px; }
.admin-history-button:disabled { color: #b8b8c0; cursor: default; }

.admin-entry {
    min-height: 36px;
    padding-inline: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
}

.admin-tabs {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 10px 24px 0;
    border-bottom: 1px solid var(--line);
}

.admin-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--ink-600);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.admin-tabs button[aria-selected="true"] {
    border-bottom-color: var(--pine-600);
    color: var(--pine-700);
}

.admin-style-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.admin-style-tabs[hidden] { display: none; }
.admin-style-tabs button { min-height: 42px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ink-600); font: inherit; font-weight: 700; cursor: pointer; }
.admin-style-tabs button[aria-selected="true"] { border-bottom-color: #1677ff; color: #1467d0; }
.admin-style-tabs button:focus-visible { outline: 2px solid #1677ff; outline-offset: -2px; }

.admin-body {
    min-height: 0;
    padding: 10px 24px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
#settings-status:empty { display: none; }
#settings-status:not(:empty) { margin: 0 0 10px; }

.admin-panel {
    min-height: 280px;
}
.admin-panel > h3:first-child { margin-top: 0; }
.outcomes-panel { color: #27232e; }
.outcomes-panel [hidden] { display: none !important; }
.outcomes-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 18px; margin-bottom: 16px; border: 1px solid #e8e2ee; border-radius: 18px; background: #faf8fc; }
.outcomes-filters label { display: grid; gap: 7px; min-width: 126px; color: #625b69; font-size: 13px; font-weight: 500; }
.outcomes-filters input,.outcomes-filters select { min-height: 40px; max-width: 205px; padding: 8px 10px; border: 1px solid #d9d3df; border-radius: 11px; background: white; color: #2b2730; font: inherit; font-size: 14px; font-weight: 400; }
.outcomes-filters input[type="search"] { width: 190px; }
.outcomes-filters .outcomes-star-toggle { display: grid; place-items: center; flex: none; min-width: 40px; width: 40px; min-height: 40px; cursor: pointer; }
.outcomes-star-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.outcomes-star-toggle span { color: #a9a3ad; font-size: 27px; line-height: 1; transition: color .2s ease, transform .2s ease; }
.outcomes-star-toggle input:checked + span { color: #eca916; transform: scale(1.12); }
.outcomes-star-toggle input:focus-visible + span { outline: 2px solid #8650be; outline-offset: 5px; border-radius: 4px; }
.outcomes-filters > label:not(.outcomes-star-toggle) { flex: none; }
.outcomes-filters .outcomes-filter-actions { display: flex; flex-wrap: nowrap; align-items: end; gap: 12px; margin-inline-start: auto; }
.outcomes-filters .outcomes-filter-actions > button { flex: none; }
.outcomes-filters .outcomes-basis-control { margin-inline-start: 0; }
.outcomes-filters > button { flex: none; }
.outcomes-filters button { min-height: 40px; }
.outcomes-source-note { padding: 12px 15px; margin: 0 0 17px; border: 1px solid #e4d7f3; border-radius: 12px; background: #f7f0fd; color: #6e4b8f; font-size: 13px; }
.outcomes-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.outcomes-card { display: grid; align-content: start; gap: 9px; min-height: 132px; padding: 20px; border: 1px solid #e9e4ed; border-radius: 17px; background: white; box-shadow: 0 7px 22px #3320440b; }
.outcomes-card-label { color: #6d6673; font-size: 13px; }
.outcomes-card-value { color: #6e3ca7; font-size: clamp(20px,2vw,29px); line-height: 1.2; overflow-wrap: anywhere; }
.outcomes-card small { color: #86808c; font-size: 12px; font-weight: 400; }
.outcomes-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.outcomes-charts section,.outcomes-list-section { padding: 19px; border: 1px solid #e9e4ed; border-radius: 17px; background: white; }
.outcomes-charts h4,.outcomes-list-section h4 { margin: 0 0 16px; font-size: 16px; }
#outcomes-status-chart { display: flex; align-items: center; gap: 22px; min-height: 205px; }
.outcomes-pie { position: relative; display: grid; place-items: center; flex: none; width: 164px; height: 164px; border-radius: 50%; background: #eceaf1; }
.outcomes-pie svg { width: 100%; height: 100%; }
.outcomes-pie-sector { cursor: pointer; }
.outcomes-pie-sector:hover,.outcomes-pie-sector:focus-visible { filter: brightness(1.12); outline: none; }
.outcomes-pie span { position: absolute; display: grid; place-items: center; width: 95px; height: 95px; border-radius: 50%; background: white; color: #44364f; font-size: 25px; font-weight: 650; pointer-events: none; }
.outcomes-pie-legend { display: grid; gap: 5px; }
#admin-dialog .outcomes-legend-item { padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: #5c5660; font-size: 12px; font-weight: 400; text-align: left; cursor: pointer; }
.outcomes-legend-item::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--swatch); }
#admin-dialog .outcomes-legend-item[aria-pressed="true"],#admin-dialog .outcomes-legend-item:hover { background: #f2eafa; color: #673899; }
#outcomes-trend-chart svg { display: block; width: 100%; height: 180px; }
.outcomes-opening-plot { position: relative; }
.outcomes-opening-point { fill: #fff; stroke: #9455c7; stroke-width: 2.5; transition: r .15s ease,fill .15s ease; }
.outcomes-opening-point.is-active { fill: #9455c7; stroke: #fff; stroke-width: 3; r: 6; }
.outcomes-opening-tooltip { position: absolute; top: 6px; z-index: 1; max-width: 92%; padding: 7px 10px; border: 1px solid #dec7ef; border-radius: 8px; background: #fff; box-shadow: 0 5px 16px #33204422; color: #503063; font-size: 12px; white-space: nowrap; transform: translateX(-50%); pointer-events: none; }
.outcomes-opening-tooltip[hidden] { display: none; }
.outcomes-opening-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.outcomes-opening-head h4 { margin: 0 auto 0 0; }
.outcomes-opening-head label { display: flex; align-items: center; gap: 6px; color: #6d6673; font-size: 12px; white-space: nowrap; }
.outcomes-opening-head select { min-height: 32px; border: 1px solid #ded7e5; border-radius: 9px; background: #fff; color: #624086; }
.outcomes-opening-modes { display: flex; padding: 3px; border-radius: 10px; background: #f4eff9; }
#admin-dialog .outcomes-opening-modes button { min-height: 30px; padding: 4px 9px; border: 0; border-radius: 8px; background: transparent; color: #756b7e; font-size: 12px; cursor: pointer; }
#admin-dialog .outcomes-opening-modes button[aria-pressed="true"] { background: #fff; color: #7743ae; box-shadow: 0 2px 6px #33204418; }
.outcomes-opening-bars { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); align-items: end; gap: 9px; height: 180px; padding: 5px 0 0; border-bottom: 1px solid #e9e4ed; }
.outcomes-opening-group { display: grid; align-items: end; justify-items: center; gap: 4px; min-width: 0; color: #817987; font-size: 11px; text-align: center; }
.outcomes-opening-pair { display: flex; align-items: end; justify-content: center; gap: 3px; width: 100%; height: 132px; }
.outcomes-opening-bar { display: block; width: min(21px,37%); height: var(--bar-height); min-height: 0; border-radius: 5px 5px 0 0; animation: outcomes-bar-rise .45s ease-out both; transform-origin: bottom; }
.outcomes-opening-incoming { background: #7894cb; }
.outcomes-opening-opened { background: #9455c7; }
.outcomes-opening-rate { color: #9455c7; }
.outcomes-opening-line { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: outcomes-line-draw .7s ease-out forwards; }
.outcomes-opening-axis { display: flex; justify-content: space-between; gap: 4px; color: #817987; font-size: 11px; }
.outcomes-opening-zoom { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: #756b7e; font-size: 12px; white-space: nowrap; }
.outcomes-opening-zoom[hidden] { display: none; }
.outcomes-opening-zoom input { flex: 1; min-width: 0; accent-color: #9455c7; }
.outcomes-opening-note { margin: 10px 0 0; color: #89808f; font-size: 11px; line-height: 1.5; }
@keyframes outcomes-bar-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes outcomes-line-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .outcomes-opening-bar,.outcomes-opening-line { animation: none; stroke-dashoffset: 0; } }
.outcomes-trend-caption { color: #817987; font-size: 12px; }
.outcomes-list-section { margin-bottom: 15px; }
.outcomes-list-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px; }
.outcomes-list-heading h4 { margin:0; }
.outcomes-list-heading label { display:flex;align-items:center;gap:8px;font-size:13px;font-weight:400;white-space:nowrap; }
.outcomes-list-heading select { width:128px;min-height:36px;font-weight:400; }
.outcomes-list-filters { display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-inline-start:auto; }
.outcomes-customer-actions { justify-content:flex-end;max-width:260px; }
.outcomes-customer-row > div.outcomes-customer-actions { gap:8px; }
.outcomes-conversion-summary { color:var(--control-accent,#8550bb);font-variant-numeric:tabular-nums; }
.outcomes-conversion-trend-section { min-width: 0; }
.outcomes-conversion-plot { position: relative; margin-top: 16px; }
.outcomes-conversion-plot svg { display: block; width: 100%; height: auto; min-height: 160px; overflow: visible; }
.conversion-trend-grid { stroke: #eae4f0; stroke-width: 1; }
.conversion-trend-axis { fill: #8b8194; font-size: 12px; }
.conversion-trend-line { stroke: #9257c8; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.conversion-trend-point { fill: #fff; stroke: #9257c8; stroke-width: 2; }
.conversion-trend-point.is-active { fill: #9257c8; stroke-width: 4; }
.outcomes-conversion-tooltip { position: absolute; top: 0; transform: translateX(-50%); width: max-content; max-width: 94%; padding: 8px 12px; border: 1px solid #e1d4ee; border-radius: 10px; color: #67478b; background: #fff; box-shadow: 0 8px 24px #4f266318; font-size: 12px; pointer-events: none; overflow-wrap: anywhere; }
.outcomes-conversion-period-control { display: flex; align-items: center; gap: 16px; margin-top: 20px; color: #81778b; font-size: 13px; white-space: nowrap; }
.outcomes-conversion-period-control input { flex: 1; min-width: 0; accent-color: #9257c8; padding: 0; }
.outcomes-conversion-ticks { display: flex; justify-content: space-between; gap: 4px; margin: 4px 0 12px; }
#admin-dialog .outcomes-conversion-ticks button { min-width: 0; min-height: 30px; padding: 3px 0; border: 0; border-radius: 0; background: transparent; color: #8b8194; box-shadow: none; font-size: 12px; font-weight: 400; white-space: nowrap; }
#admin-dialog .outcomes-conversion-ticks button[aria-pressed=true] { color: #8147bd; }
.outcomes-conversion-trend-section output { color: #8550bb; font-size: 13px; }
@media(max-width:620px){.outcomes-conversion-ticks{margin-left:0}.outcomes-conversion-period-control{gap:10px}.outcomes-conversion-tooltip{font-size:11px}}
.outcomes-conversion-row { display:grid;grid-template-columns:minmax(90px,1fr) minmax(90px,3fr) auto;align-items:center;gap:12px;margin:12px 0; }
.outcomes-conversion-row > span { overflow-wrap:anywhere; }
.outcomes-conversion-row progress { width:100%;height:12px;accent-color:var(--control-accent,#8550bb); }
.outcomes-conversion-row small { color:#81778b;font-variant-numeric:tabular-nums; }
@media(max-width:620px){.outcomes-conversion-row{grid-template-columns:minmax(60px,1fr) minmax(50px,2fr) auto;gap:8px}.outcomes-customer-actions{max-width:none;justify-content:flex-start;}}
.outcomes-customer-row { display: grid; grid-template-columns: minmax(140px,1fr) minmax(180px,2fr) auto; align-items: center; gap: 15px; padding: 13px 4px; border-top: 1px solid #efebf2; font-size: 13px; }
.outcomes-customer-row > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.outcomes-customer-row small { color: #8e8695; font-size: 12px; }
.outcomes-customer-row .outcomes-star { color: #e3a012; font-size: 18px; }
.outcomes-customer-row button { justify-self: end; }
.outcomes-empty { color: #918a98; font-size: 13px; }
.outcomes-pagination { display: flex; align-items: center; justify-content: end; gap: 10px; padding-top: 15px; border-top: 1px solid #efebf2; color: #77717d; font-size: 12px; }
.outcomes-pagination label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.outcomes-pagination select,.outcomes-pagination button { min-height: 35px; border: 1px solid #ded7e5; border-radius: 9px; background: #faf8fc; color: #624086; font: inherit; }
.outcomes-pagination button:disabled { opacity: .42; }
.outcomes-customer-row[role="button"] { cursor: pointer; }
.outcomes-customer-row[role="button"]:hover { background: #faf7fd; }
.outcomes-customer-row[role="button"]:focus-visible { outline: 2px solid #9455c7; outline-offset: 2px; }
@media (max-width: 900px) { .outcomes-cards { grid-template-columns: repeat(2,minmax(0,1fr)); } .outcomes-charts { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .outcomes-filters label,.outcomes-filters select { min-width: 0; } .outcomes-filters .outcomes-filter-actions { margin-inline-start: 0; flex-wrap: wrap; } .outcomes-list-filters { margin-inline-start: 0; width: 100%; } .outcomes-cards { grid-template-columns: 1fr; } .outcomes-customer-row { grid-template-columns: 1fr; } .outcomes-pagination { flex-wrap: wrap; } }

.admin-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.admin-section-heading p,
.provider-card p,
.asset-review-card p {
    margin: 4px 0 0;
    color: var(--ink-600);
    line-height: 1.55;
}

.provider-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 16px;
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #cfe2d9;
    border-radius: 14px;
    background: #f6fbf8;
}

.business-product-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.business-product-actions button {
    min-width: 104px;
}
.product-sku-section { margin-top: 22px; padding: 18px; border: 1px solid #e5e5ea; border-radius: 18px; background: #fbfbfd; }
.business-inherited-introduction { margin-top: 18px; padding: 16px 18px; border: 1px solid #e5e5ea; border-radius: 16px; background: #fbfbfd; }
.business-inherited-introduction[hidden] { display: none; }
.business-inherited-introduction h4 { margin: 0 0 8px; color: #1d1d1f; font-size: 14px; }
.business-inherited-introduction p { margin: 0; color: #6e6e73; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.product-sku-heading, .product-sku-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-sku-heading h4 { margin: 0; font-size: 16px; font-weight: 650; }
.product-sku-heading p { margin: 5px 0 0; color: #6e6e73; font-size: 12px; }
.product-sku-tools { justify-content: flex-start; flex-wrap: wrap; margin: 15px 0 10px; }
.product-sku-tools label { display: inline-flex; flex: none; align-items: center; gap: 7px; white-space: nowrap; }
.product-sku-tools .product-sku-search { margin-left: auto; }
.product-sku-search input { width: min(300px, 32vw); min-height: 40px; padding: 8px 11px; border: 1px solid var(--control-border); border-radius: 10px; background: #fff; color: var(--control-ink); font-size: 13px; font-weight: 400; }
.product-sku-list { display: grid; gap: 8px; }
.product-sku-pagination, .member-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: var(--ink-600); font-size: 13px; }
.settings-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; color: var(--ink-600); font-size: 13px; }
.settings-pagination label, .settings-pagination > div { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; }
.settings-pagination select, .settings-pagination button { min-height: 36px; margin: 0; padding: 6px 12px; border: 1px solid var(--control-border, #ded7e5); border-radius: 9px; background: var(--paper, #fff); color: var(--control-ink, #624086); font: inherit; font-weight: 400; }
.settings-pagination button:disabled { opacity: .42; cursor: default; }
.chat-customer-cell span, .chat-customer-cell small { display: block; overflow-wrap: anywhere; }
.chat-customer-cell small { margin-top: 4px; color: var(--ink-600); font-size: 12px; font-weight: 400; }
.chat-history-dialog { width: min(800px, calc(100vw - 32px)); max-width: none; max-height: min(84dvh, 880px); padding: 0; border: 1px solid var(--line-strong, #ded7e5); border-radius: 20px; background: var(--paper, #fff); color: var(--ink-900); overflow: hidden; box-shadow: 0 24px 70px #21182e33; }
.chat-history-dialog[open] { display: flex; flex-direction: column; }
.chat-history-dialog::backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.chat-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; padding: 22px 24px; background: linear-gradient(110deg, #f5effc, #fcf6fb); border-bottom: 1px solid #e8e2ed; }
.chat-history-heading h2 { margin: 0; font-size: 21px; }
.chat-history-heading p { margin: 7px 0 0; color: var(--ink-600); font-size: 13px; overflow-wrap: anywhere; }
.chat-history-heading .dialog-close { display: grid; place-items: center; box-sizing: border-box; flex: 0 0 28px; width: 28px; height: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 50%; background: #f0edf3; color: #77717d; }
.chat-history-heading .dialog-close svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-history-body { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 20px 24px; }
.chat-history-entry { max-width: 90%; margin: 0 0 16px; padding: 12px 15px; border: 1px solid #e8e2ed; border-radius: 14px; background: #faf9fc; }
.chat-history-entry.is-sales { margin-left: auto; background: #f3ecfc; border-color: #e6d9f4; }
.chat-history-meta { margin: 0 0 7px; color: #81788b; font-size: 12px; font-weight: 400; }
.chat-history-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; font-weight: 400; }
.chat-history-filter { display: grid; grid-template-columns: 30px minmax(120px,1fr) 102px 120px 80px 110px 112px 62px; align-items: end; gap: 9px; margin-bottom: 20px; }
#admin-dialog .chat-history-filter label, #admin-dialog .chat-date-field { display: grid; gap: 7px; min-width: 0; color: #77717d; font-size: 12px; font-weight: 400; }
#admin-dialog .chat-history-filter input:not([type=checkbox]), #admin-dialog .chat-history-filter select, #admin-dialog .chat-history-filter > button:not(.chat-star-filter), #admin-dialog .chat-history-filter summary { box-sizing: border-box; width: 100%; height: 38px; min-height: 38px; margin: 0; padding: 7px 10px; border: 1px solid #ded7e5; border-radius: 9px; background: #fff; color: #51465e; font-family: inherit; font-size: 13px; line-height: 22px; font-weight: 400; white-space: nowrap; }
#admin-dialog .chat-history-filter summary { display: block; cursor: pointer; text-align: center; list-style: none; color: #8150b5; }
#admin-dialog .chat-history-filter summary::-webkit-details-marker { display: none; }
#admin-dialog #chat-star-filter { border: 0; background: transparent; color: #b6b3bd; font-size: 25px; padding: 0; height: 38px; min-height: 38px; width: 30px; box-shadow: none; cursor: pointer; }
#admin-dialog #chat-star-filter[aria-pressed=true] { color: #eda51d; }
#admin-dialog .chat-history-filter select:disabled { opacity: 1; background: #f4f3f6; color: #8b8492; }
#admin-dialog #chat-history-filter > button[type=submit] { height: 38px; min-height: 38px; padding: 7px 10px; }
#chat-date-menu { position: fixed; margin: 0; width: min(272px,calc(100vw - 24px)); padding: 16px; box-sizing: border-box; border: 1px solid #e2daeb; border-radius: 14px; background: #fff; box-shadow: 0 14px 40px #30203f26; }
#chat-date-menu:popover-open { display: grid; gap: 12px; }
.chat-date-heading { display: flex; align-items: center; justify-content: space-between; color: #51465e; }
#chat-date-close { background: none; border: 0; color: #8150b5; font-size: 21px; cursor: pointer; padding: 0 4px; }
.chat-history-table .admin-data-table { width: 100%; min-width: 0; table-layout: fixed; }
.chat-history-table th:first-child { width: 32px; }.chat-history-table th:nth-child(2) { width: 36px; }
.chat-history-table th:nth-child(4) { width: 145px; }.chat-history-table th:nth-child(5), .chat-history-table th:nth-child(6) { width: 65px; }.chat-history-table th:last-child { width: 106px; }
.chat-history-table td { white-space: normal; overflow-wrap: anywhere; }
.chat-history-table input[type=checkbox], .chat-bulk-actions input { width: 16px; height: 16px; accent-color: #8651bb; }
.chat-history-table tr[role=button] { cursor: pointer; }.chat-history-table tr[role=button]:hover { background: #faf7fe; }
.chat-history-table tr[role=button]:focus-visible { outline: 2px solid #a77bd1; outline-offset: -2px; }
.chat-star { font-size: 21px; color: #b6b3bd; }.chat-star.is-starred { color: #eda51d; }
.chat-list-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.chat-list-footer .settings-pagination { margin: 0; }.chat-bulk-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: #81788b; }
.chat-bulk-actions label { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.chat-window-controls { display: flex; gap: 6px; flex-shrink: 0; }
.chat-history-dialog { resize: both; min-width: min(358px,calc(100vw - 32px)); min-height: 240px; }
.chat-history-dialog.is-maximized { width: calc(100vw - 24px) !important; height: calc(100dvh - 24px) !important; max-height: none; margin: 12px; resize: none; }
.chat-history-dialog.is-minimized { top: auto; left: auto; right: 16px; bottom: 16px; margin: 0; width: min(358px,calc(100vw - 32px)) !important; height: auto !important; min-height: 0; resize: none; }
.chat-history-dialog.is-minimized .chat-history-body { display: none; }.chat-history-dialog.is-minimized .chat-history-heading { padding: 12px; }.chat-history-dialog.is-minimized h2 { font-size: 16px; }.chat-history-dialog.is-minimized #chat-history-customer { display: none; }
.chat-history-meta > span { display: block; font-size: 15px; color: #55485f; font-weight: 500; }.chat-history-meta time { display: block; margin-top: 4px; color: #99929f; font-size: 11px; font-weight: 400; }
.chat-summary { margin-top: 24px; padding: 18px; border: 1px solid #e9e1f2; border-radius: 14px; background: #fcfafe; }
.chat-summary-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }.chat-summary-title { display: flex; align-items: center; gap: 10px; min-width: 0; }.chat-summary h3 { margin: 0; font-size: 16px; }.chat-summary h4 { margin: 16px 0 7px; font-size: 13px; color: #7e6595; }.chat-summary p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 14px; font-weight: 400; }
.chat-summary-score { flex: none; min-width: 50px; padding: 4px 9px; border-radius: 999px; background: #efe6f8; color: #6b3fa0; font-size: 13px; font-weight: 700; text-align: center; }
.chat-summary-score[data-empty="true"] { color: #8d8397; font-weight: 400; }
.chat-summary button, .chat-delete-dialog footer button { border: 1px solid #ded7e5; border-radius: 9px; background: #f7f5f9; color: #655374; padding: 8px 13px; font: inherit; font-size: 13px; font-weight: 400; }
.chat-delete-dialog { width: min(480px,calc(100vw - 32px)); padding: 24px; box-sizing: border-box; border: 1px solid #e4deea; border-radius: 18px; box-shadow: 0 24px 70px #21182e33; background: #fff; color: #32283d; }.chat-delete-dialog::backdrop { background: #21182e66; backdrop-filter: blur(3px); }
.chat-delete-dialog header, .chat-delete-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.chat-delete-dialog h2 { margin: 0; font-size: 19px; }.chat-delete-dialog p { font-size: 14px; line-height: 1.8; margin: 20px 0; }.chat-delete-dialog footer { justify-content: flex-end; }.chat-delete-dialog footer .danger-button { background: #c72e4e; color: #fff; border-color: #c72e4e; }
#chat-restore-dialog { width: min(620px,calc(100vw - 32px)); }
#chat-restore-dialog .usage-modal-form { display: flex; align-items: end; gap: 10px; margin: 12px 0; }
#chat-restore-dialog .usage-modal-form label { flex: 1; }
#chat-restore-list { max-height: 45vh; overflow: auto; margin: 12px 0; }
.chat-restore-row { display: flex; align-items: start; gap: 10px; padding: 10px 8px; border-bottom: 1px solid #eee8f2; font-size: 13px; line-height: 1.6; cursor: pointer; }
.chat-restore-row input { margin-top: 3px; }
@media (max-width: 940px) { .chat-history-filter { grid-template-columns: repeat(8,minmax(0,1fr)); }.chat-history-filter > * { grid-column: span 2; }.chat-history-filter > .chat-star-filter { grid-column: span 1; }.chat-history-filter > label:has(input[name=q]) { grid-column: span 3; } }
@media (max-width: 620px) { .chat-history-filter { grid-template-columns: repeat(6,minmax(0,1fr)); }.chat-history-filter > * { grid-column: span 3; }.chat-history-filter > .chat-star-filter { grid-column: span 1; }.chat-history-filter > label:has(input[name=q]) { grid-column: span 5; }.chat-history-heading { gap: 8px; }.chat-history-heading h2 { font-size: 18px; }.chat-history-table thead { display: none; }.chat-history-table tbody tr { display: grid; grid-template-columns: 24px 28px minmax(0,1fr); padding: 12px; border-bottom: 1px solid #ebe6f0; }.chat-history-table td { border: 0 !important; padding: 5px !important; }.chat-history-table td:nth-child(n+4) { grid-column: 3; }.chat-history-table td:nth-child(4)::before { content: '沟通时间 '; color: #99929f; }.chat-history-table td:nth-child(5)::before { content: '是否成交 '; color: #99929f; }.chat-history-table td:nth-child(6)::before { content: '有无回访 '; color: #99929f; } }
@media (max-width: 620px) { .chat-history-heading { padding: 18px 16px; } .chat-history-body { padding: 16px; } .chat-history-entry { max-width: 100%; } .settings-pagination { gap: 10px; } }
.product-sku-pagination[hidden] { display: none; }
.product-sku-pagination label, .product-sku-pagination > div, .member-pagination label, .member-pagination > div { display: inline-flex; align-items: center; gap: 8px; }
.product-sku-pagination label, .member-pagination label { white-space: nowrap; flex-shrink: 0; }
.product-sku-pagination select, .member-pagination select { min-height: 36px; padding: 6px 9px; border: 1px solid var(--control-border); border-radius: 9px; background: #fff; color: var(--control-ink); font-size: 13px; font-weight: 400; }
.product-sku-pagination button, .member-pagination button { min-height: 36px; }
.product-sku-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid #e5e5ea; border-radius: 13px; background: #fff; }
.product-sku-row strong { display: block; color: #1d1d1f; font-size: 13px; }
.product-sku-row small { color: #6e6e73; line-height: 1.5; }
.product-sku-row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.product-sku-readonly { grid-template-columns: minmax(0, 1fr); }
.product-sku-enterprise:has(> #product-sku-inherited[hidden]) { display: none; }
#product-sku-inherited { margin-top: 0; }
#product-sku-inherited h5 { margin: 0 0 8px; color: var(--ink-600); font-size: 13px; font-weight: 600; }
#product-sku-inherited[hidden] { display: none; }
.product-sku-empty { padding: 18px; border: 1px dashed #d2d2d7; border-radius: 13px; color: #6e6e73; text-align: center; }
@media (max-width: 640px) { .product-sku-heading { align-items: flex-start; } .product-sku-row { grid-template-columns: auto minmax(0, 1fr); } .product-sku-row-actions { grid-column: 2; } .product-sku-tools .product-sku-search { flex: 1 1 100%; margin-left: 0; } .product-sku-search input { flex: 1 1 auto; width: 100%; min-width: 0; } }

.provider-form label {
    display: grid;
    gap: 7px;
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 700;
}

.provider-form input:not([type="checkbox"]),
.provider-form textarea,
.provider-form select {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--ink-900);
    font: inherit;
}

.provider-form textarea {
    min-height: 104px;
    line-height: 1.55;
    resize: vertical;
}

.provider-form input:focus,
.provider-form textarea:focus,
.provider-form select:focus {
    border-color: var(--pine-600);
    outline: 3px solid rgba(22, 122, 85, 0.14);
}

.provider-wide,
.provider-security-note {
    grid-column: 1 / -1;
}

.member-account-fieldset {
    margin: 0;
    padding: 12px 13px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
}

.member-account-fieldset legend {
    padding-inline: 5px;
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 800;
}

.member-account-fieldset p {
    margin: 8px 0 0;
    color: var(--ink-400);
    font-size: 12px;
}

.member-account-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.member-account-list label {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 7px;
    min-height: 32px;
}

.member-account-list input {
    width: 17px;
    height: 17px;
}

.member-form-actions {
    display: flex;
    gap: 10px;
}

.member-style-field { display: grid; gap: 7px; min-width: 0; color: #48484a; font-size: 13px; font-weight: 600; }
.member-style-menu { position: relative; min-width: 0; }
.member-style-trigger { width: 100%; min-height: 44px; padding: 9px 34px 9px 12px; border: 1px solid #d2d2d7; border-radius: 12px; background: #fff; color: #303036; text-align: left; font: inherit; font-weight: 500; cursor: pointer; }
.member-style-trigger::after { content: "⌄"; position: absolute; right: 14px; color: #6e6e73; font-size: 18px; line-height: 1; }
.member-style-trigger:hover { border-color: #9da8b8; }
.member-style-trigger:focus-visible, .member-style-option:focus-visible { outline: 3px solid rgb(128 82 190 / 32%); outline-offset: 2px; }
.member-style-options { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; width: 100%; max-height: 286px; overflow-y: auto; padding: 5px; border: 1px solid #d2d2d7; border-radius: 13px; background: #fff; box-shadow: 0 14px 30px rgb(31 42 61 / 16%); }
.member-style-options[hidden] { display: none; }
.member-style-option { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: transparent; color: #303036; text-align: left; font: inherit; font-weight: 500; cursor: pointer; }
.member-style-option:hover, .member-style-option:focus-visible { background: var(--control-accent-soft); color: var(--control-accent); }
.member-style-option[aria-selected="true"] { background: var(--control-accent-soft); color: var(--control-accent); }
.member-style-option-detail { display: none; margin-top: 4px; color: #6e6e73; font-size: 11px; font-weight: 400; line-height: 1.4; white-space: normal; }
.member-style-option:hover .member-style-option-detail, .member-style-option:focus .member-style-option-detail { display: block; }
.member-status-field { max-width: 220px; }

.member-role-badge,
.member-disabled-badge {
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf3f8;
    color: var(--ink-600);
    font-size: 12px;
    font-weight: 800;
}

.member-disabled-badge {
    background: #f7eceb;
    color: var(--danger);
}

.policy-form .primary-button {
    justify-self: start;
    min-width: 180px;
}

.policy-term-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 14px; }
.policy-term-tag { display: inline-flex; align-items: center; max-width: 100%; padding: 7px 12px; border: 1px solid #dcd2f2; border-radius: 999px; background: #f7f2ff; color: #6747a4; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
#policy-readonly > p { color: #77738a; font-size: 13px; }

.member-list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#admin-dialog #member-name-search {box-sizing:border-box;flex:0 1 200px;width:200px;max-width:100%;min-width:120px;min-height:36px;margin:0;padding:8px 12px;font-weight:400;}
.member-group-members { min-width: 0; margin: 0; padding: 14px; border: 1px solid #e2d7f1; border-radius: 12px; }
.member-group-members legend { padding: 0 5px; font-size: 13px; font-weight: 600; }
.member-group-members[hidden] { display: none; }
.member-group-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); gap: 8px 16px; max-height: 240px; overflow-y: auto; margin-bottom: 8px; }
.member-group-options label { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 400; overflow-wrap: anywhere; }
.member-group-options input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; }
.member-group-candidates { display: flex; flex-wrap: wrap; gap: 8px 18px; max-height: 180px; overflow-y: auto; }
.member-group-candidates label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; }
.member-group-candidates input { width: 17px; height: 17px; }
.member-group-selected { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.member-group-selected:empty { display: none; }
.member-group-selected span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 9px; background: #f4effb; color: #583489; font-size: 13px; }
.member-group-selected button { border: 0; padding: 0 2px; background: transparent; color: inherit; cursor: pointer; font: inherit; line-height: 1; }
.leader-group-members { margin-bottom: 12px; }
#member-form[hidden], #member-list-screen[hidden], #member-new[hidden], #admin-member-controls[hidden], #sales-self-account[hidden] { display: none !important; }

.grading-rules-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grading-dimension-grid { display: grid; gap: 10px; }
.grading-dimension-row { display: grid; grid-template-columns: 1.6fr .7fr .9fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.grading-dimension-row label, .grading-thresholds label { display: grid; gap: 6px; }
.grading-thresholds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grading-safety-note { color: var(--danger); font-weight: 700; }
#grading-validation { min-height: 20px; color: var(--danger); font-weight: 700; }

.provider-activate {
    display: flex !important;
    align-items: center;
    min-height: 44px;
}

.provider-activate input {
    width: 18px;
    height: 18px;
}

.provider-security-note {
    margin: 0;
    color: var(--ink-600);
    font-size: 12px;
}

.admin-list {
    display: grid;
    gap: 10px;
}
.member-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.member-batch-actions[hidden] { display: none; }
.member-list-toolbar > #member-new { margin-left: auto; }
#member-new { margin-top: 0; }
.member-batch-actions button { min-height: 34px; padding: 0 12px; border: 1px solid #d2d2d7; border-radius: 10px; background: #f5f5f7; color: #3a3a3c; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.member-batch-actions button:hover { background: #e9e9ed; }
.member-batch-actions [data-member-action="delete"] { color: #b4232c; }
.member-row-actions { min-width: 155px; }
.member-row-actions .admin-action { margin-right: 3px; }

.admin-data-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.admin-data-table { width: 100%; min-width: 740px; border-collapse: collapse; font-size: 13px; }

.admin-data-table th, .admin-data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.admin-data-table th { background: #f0f3f8; color: var(--ink-700); font-weight: 700; }
.admin-data-table tbody tr:hover { background: #f5f8fd; }
.admin-data-table tbody tr:last-child td { border-bottom: 0; }
.admin-data-table td strong { display: block; font-weight: 700; }
.admin-data-table td small { display: block; margin-top: 3px; color: var(--ink-500); }
.admin-data-table td .admin-action { min-height: 30px; padding: 0 9px; color: var(--sales-blue-700); border-color: transparent; }
.admin-data-table td .admin-action:hover { background: var(--sales-blue-50); }
.admin-data-table td input[type="checkbox"] { width: 17px; height: 17px; }
.admin-data-table th input[type="checkbox"] { width: 17px; min-width: 17px; height: 17px; min-height: 17px; margin: 0; }
#member-list .admin-data-table th input[type="checkbox"], #member-list .admin-data-table td input[type="checkbox"] { width: 15px; min-width: 15px; height: 15px; min-height: 15px; padding: 0; margin: 0; }
.admin-table-empty { text-align: center !important; color: var(--ink-500); }
.admin-table-note { min-width: 180px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.admin-data-table tr.is-cancelled { color: var(--ink-500); }
.admin-table-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.admin-table-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aab3bd; }
.admin-table-status.is-active::before { background: #22ad45; }

.admin-followup-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 0 0 14px; padding: 12px; border: 1px solid #e5e5ea; border-radius: 16px; background: #f8f9fb; }
.admin-followup-search { flex: 1 1 150px; max-width: 180px; }
.admin-followup-compact { flex: 0 0 104px; }
#admin-followup-filter .admin-followup-search input { max-width: none; }
.admin-followup-filter label { display: grid; gap: 6px; min-width: 0; color: #6e6e73; font-size: 12px; font-weight: 600; }
.admin-followup-filter select, .admin-followup-filter input[type="date"] { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; color: #303036; font: inherit; font-size: 12px; font-weight: 500; }
.admin-followup-star-filter { display: inline-flex; flex: 0 0 28px; align-items: center; justify-content: center; width: 28px; min-height: 38px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; white-space: nowrap; }
.admin-followup-star-filter .star-glyph { color: #afb3bb; }
.admin-followup-star-filter[aria-pressed="true"] { background: transparent; }
.admin-followup-star-filter[aria-pressed="true"] .star-glyph { color: #f0a900; }
#admin-dialog #admin-followup-star-filter { min-width: 28px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#admin-dialog #admin-followup-star-filter:hover { border: 0; background: transparent; }
.admin-followup-staff-field { position: relative; display: grid; flex: 0 0 120px; gap: 6px; min-width: 0; color: #6e6e73; font-size: 12px; font-weight: 400; }
.admin-followup-range-picker { position: relative; flex: 0 0 100px; }
.admin-followup-range-picker summary { display: flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid var(--control-border); border-radius: 10px; color: var(--control-accent); background: #fff; cursor: pointer; list-style: none; white-space: nowrap; font-size: 12px; }
.admin-followup-range-menu { position: fixed; inset: auto; z-index: 201; display: grid; gap: 10px; width: 260px; max-height: calc(100dvh - 32px); margin: 0; padding: 12px; overflow-y: auto; border: 1px solid var(--control-border); border-radius: 12px; background: #fff; box-shadow: 0 12px 28px #14223824; }
.admin-followup-range-menu:not(:popover-open) { display: none; }
.admin-followup-range-heading { display: flex; align-items: center; justify-content: space-between; color: #48484a; font-size: 13px; }
#admin-dialog #admin-followup-close-dates { display: grid; place-items: center; flex: none; width: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: #6e6e73; font-size: 20px; font-weight: 400; line-height: 1; cursor: pointer; }
#admin-dialog #admin-followup-close-dates:is(:hover,:focus-visible,:active) { color: var(--control-accent); border: 0; background: transparent; box-shadow: none; }
.admin-followup-range-hint { margin: 0; color: #86868b; font-size: 11px; font-weight: 400; }
#admin-followup-filter .admin-followup-unread { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 6px; min-height: 38px; white-space: nowrap; font-weight: 400; }
#admin-followup-filter .admin-followup-unread input { width: 15px; height: 15px; min-width: 15px; min-height: 15px; margin: 0; }
.admin-followup-staff-picker { position: relative; }
.admin-followup-staff-picker summary { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 7px 10px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; color: #303036; cursor: pointer; list-style: none; }
.admin-followup-staff-picker summary::-webkit-details-marker { display: none; }
.admin-followup-staff-picker summary::after { content: "⌄"; color: #777; }
.admin-followup-staff-menu { position: absolute; z-index: 200; top: calc(100% + 4px); left: 0; width: max(100%, 220px); padding: 8px; border: 1px solid #d2d2d7; border-radius: 12px; background: #fff; box-shadow: 0 12px 28px #14223824; }
.admin-followup-staff-menu input[type="search"] { width: 100%; min-height: 36px; margin-bottom: 6px; padding: 6px 9px; border: 1px solid #d2d2d7; border-radius: 8px; }
#admin-followup-staff-options { max-height: 400px; overflow-y: auto; overscroll-behavior: contain; }
#admin-dialog #admin-followup-staff-options button { display: block; width: 100%; min-height: 42px; padding: 9px 11px; border: 0; border-radius: 0; background: #fff; color: var(--control-ink); box-shadow: none; text-align: left; cursor: pointer; }
#admin-dialog #admin-followup-staff-options button + button { border-top: 1px solid var(--control-border); }
#admin-dialog #admin-followup-staff-options button:hover,#admin-dialog #admin-followup-staff-options button[aria-selected="true"] { background: var(--control-accent-soft); color: var(--control-accent); }
.admin-followup-filter-actions { display: flex; align-items: center; gap: 7px; }
.admin-followup-filter-actions button { min-height: 38px; padding: 0 13px; white-space: nowrap; }
.admin-followup-filter-actions button[type="submit"] { border-color: var(--control-accent); background: var(--control-accent); color: #fff; }
#admin-dialog #admin-followup-filter { --followup-filter-height: 42px; }
#admin-dialog #admin-followup-filter :is(input[name="contact_search"],select[name="grade"],select[name="date_field"],#admin-followup-staff-trigger,#admin-followup-range-picker > summary,.admin-followup-filter-actions > button) {
    box-sizing: border-box; height: var(--followup-filter-height); min-height: var(--followup-filter-height);
    margin: 0; padding: 0 12px; line-height: normal; font-weight: 400;
}
#admin-dialog #admin-followup-filter :is(.admin-followup-unread,#admin-followup-star-filter) { height: var(--followup-filter-height); min-height: var(--followup-filter-height); }
#tenant-followups .admin-data-table-wrap { border-color: #e5e5ea; border-radius: 15px; }
#tenant-followups .admin-data-table { min-width: 0; width: 100%; table-layout: fixed; font-size: 12px; }
#tenant-followups .admin-data-table th { background: #f5f5f7; color: #6e6e73; font-weight: 600; }
#tenant-followups .admin-data-table th, #tenant-followups .admin-data-table td { padding: 14px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
#tenant-followups .admin-data-table td strong { color: #1d1d1f; font-weight: 650; }
#tenant-followups .admin-data-table td .admin-action { border-radius: 9px; background: #f5f5f7; color: var(--control-accent); font-weight: 650; }
#tenant-followups .admin-data-table td .admin-action:hover { background: var(--control-accent-soft); color: var(--control-accent-hover); }
.admin-followup-record-row { cursor: pointer; }
.admin-followup-record-row:hover { background: #faf7fe; }
.admin-followup-record-row:focus-visible { outline: 2px solid var(--control-accent); outline-offset: -2px; }
#tenant-followups :is(th,td):first-child { width: 48px; }
#tenant-followups :is(th,td):nth-child(2) { width: 48px; text-align: center; }
#tenant-followups :is(th,td):is(:nth-child(3),:nth-child(4)) { width: 12%; }
#tenant-followups :is(th,td):is(:nth-child(5),:nth-child(6)) { width: 15%; }
#tenant-followups :is(th,td):nth-child(8) { width: 148px; }
#tenant-followups .admin-data-table td .admin-action { max-width: 100%; min-width: 0; white-space: nowrap; }
.admin-followup-record-star { color: #b5bac2; font-size: 19px; }
.admin-followup-record-star.is-starred { color: #f0a900; }
.admin-followup-list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: 100%; margin-top: 10px; padding: 14px 0; min-width: 0; border-top: 1px solid #e8e5ee; }
.admin-followup-bulk,.admin-followup-pages { display: flex; flex-wrap: wrap; min-width: 0; max-width: 100%; align-items: center; gap: 9px; white-space: nowrap; }
.admin-followup-bulk > span,.admin-followup-pages > span { color: #86868b; font-size: 12px; font-weight: 400; }
#admin-dialog .admin-followup-list-footer :is(button,select) { box-sizing: border-box; height: 38px; min-height: 38px; padding: 6px 10px; font-size: 12px; font-weight: 400; }
#admin-dialog #admin-followup-batch-delete { color: #c93448; border-color: #f2cbd2; background: #fff; }
#admin-dialog #admin-followup-batch-delete:hover { background: #fff5f6; }
.admin-followup-bulk label,.admin-followup-pages label,.admin-followup-pages > div { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.admin-followup-bulk input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; min-height: 16px; margin: 0; }
.admin-followup-pages select { min-height: 36px; margin-left: 5px; border: 1px solid #d2d2d7; border-radius: 9px; background: #fff; }
.admin-followup-list-footer button { min-height: 36px; padding: 0 11px; border: 1px solid #d2d2d7; border-radius: 9px; background: #fff; }
.admin-followup-list-footer button:disabled { opacity: .46; cursor: default; }
#manager-follow-up-dialog { width: min(760px, calc(100vw - 28px)); max-height: min(850px, calc(100vh - 28px)); padding: 0; border: 1px solid var(--control-border); border-radius: 22px; background: #fff; color: var(--control-ink); box-shadow: 0 24px 80px #1b15333d; }
#manager-follow-up-dialog::backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
#manager-follow-up-dialog .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 28px; border-bottom: 1px solid var(--control-border); background: linear-gradient(110deg, #faf5ff, #f8f2fc); }
#manager-follow-up-dialog .dialog-header h2 { margin: 0 0 4px; font-size: 22px; }
#manager-follow-up-customer { margin: 0; color: #666676; }
#manager-follow-up-dialog .icon-button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #f0f0f3; color: #696974; font-size: 22px; }
#manager-follow-up-dialog { overflow: hidden; }
#manager-follow-up-dialog[open] { display: flex; flex-direction: column; height: min(850px, calc(100dvh - 28px)); }
#manager-follow-up-dialog .dialog-header { flex: 0 0 auto; }
.manager-follow-up-body { display: grid; align-content: start; gap: 22px; flex: 1; min-height: 0; padding: 24px 28px 30px; overflow-y: auto; overscroll-behavior: contain; }
.manager-follow-up-profile { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #72717c; }
#manager-follow-up-star { color: #b8bbc4; font-size: 24px; line-height: 1; }
#manager-follow-up-star.is-starred { color: #efab24; }
#manager-follow-up-grade { padding: 5px 10px; border-radius: 8px; background: #f4f2f8; color: #554467; font-size: 12px; }
#manager-follow-up-owner { margin-left: auto; }
.manager-follow-up-form, .manager-follow-up-history-section { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--control-border); border-radius: 17px; background: #fff; }
.manager-follow-up-form[hidden] { display: none; }
.manager-follow-up-form .follow-up-time-fields { margin: 0; }
.manager-follow-up-form .follow-up-time-fields label { display: grid; gap: 7px; }
.manager-follow-up-form .follow-up-note-field { display: grid; gap: 7px; min-width: 0; }
.manager-follow-up-form .follow-up-note-field > label { color: #5a5964; font-size: 13px; }
.manager-follow-up-form .follow-up-note-shell { position: relative; display: grid; min-width: 0; border: 1px solid #d7d7df; border-radius: 11px; background: #fff; overflow: hidden; }
.manager-follow-up-form .follow-up-note-shell:focus-within { border-color: #9056c8; box-shadow: 0 0 0 3px rgb(144 86 200 / 14%); }
.manager-follow-up-form .follow-up-note-shell textarea { display: block; width: 100%; max-width: 100%; max-height: none; min-height: 78px; padding: 11px 12px; border: 0; border-radius: 0; line-height: 1.5; resize: vertical; }
.manager-follow-up-form .follow-up-note-shell.has-rating textarea { padding-bottom: 38px; }
.manager-follow-up-form .follow-up-note-shell textarea:focus-visible { outline: none; box-shadow: none; }
.manager-follow-up-form .follow-up-create-options { position: absolute; left: 12px; right: 12px; bottom: 5px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin: 0; pointer-events: none; }
.manager-follow-up-form .follow-up-create-options > * { pointer-events: auto; }
.manager-follow-up-form .follow-up-create-options[hidden] { display: none; }
.manager-follow-up-form .follow-up-star { display: flex; align-items: center; width: 28px; min-height: 28px; height: 28px; margin: 0; }
.manager-follow-up-form .follow-up-star input { position: absolute; opacity: 0; width: 22px; height: 22px; min-height: 0; padding: 0; }
.manager-follow-up-form .follow-up-star .star-glyph { display: inline-block; width: 22px; height: 22px; background: none; mask: none; -webkit-mask: none; color: #b8bbc4; font-size: 22px; line-height: 22px; text-align: center; }
.manager-follow-up-form .follow-up-star input:checked + .star-glyph { color: #e9a300; }
.manager-follow-up-form .follow-up-grade-choices { display: flex; flex: none; gap: 6px; width: auto; }
.manager-follow-up-form .follow-up-grade-choices button { flex: none; width: 32px; height: 28px; min-height: 28px; padding: 0; border-radius: 7px; font-size: 12px; font-weight: 400; }
.manager-follow-up-form-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.manager-follow-up-form .follow-up-stop-label { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; margin: 0 auto 0 0; color: #4b4c53; font-size: 13px; white-space: nowrap; }
.manager-follow-up-form .follow-up-stop-label[hidden] { display: none; }
.manager-follow-up-form .follow-up-stop-label input { width: 18px; height: 18px; min-height: 0; padding: 0; }
.manager-follow-up-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.manager-follow-up-history-heading h3 { margin: 0; }
#manager-follow-up-guidance { flex: none; min-height: 36px; padding: 0 17px; border: 1px solid #e1d4f3; border-radius: 999px; background: var(--control-accent-soft); color: var(--control-accent); font-size: 13px; font-weight: 700; box-shadow: none; }
#manager-follow-up-guidance:hover { border-color: #cdb8e8; background: #eee2f9; color: var(--control-accent-hover); }
#manager-follow-up-guidance:focus-visible { outline: 3px solid rgb(144 86 200 / 24%); outline-offset: 2px; }
#manager-follow-up-guidance[hidden] { display: none; }
.manager-follow-up-form-heading h3, .manager-follow-up-history-section h3 { margin: 0; font-size: 17px; }
.manager-follow-up-form-heading p { margin: 5px 0 0; color: #777782; font-size: 13px; }
.manager-follow-up-form label { display: grid; gap: 7px; color: #5a5964; font-size: 13px; }
.manager-follow-up-form :is(input,textarea), .manager-follow-up-inline-edit :is(input,textarea) { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--control-border); border-radius: 10px; background: #fff; color: var(--control-ink); resize: vertical; }
.manager-follow-up-actions, .manager-follow-up-entry-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.manager-follow-up-actions button, .manager-follow-up-entry-actions button { min-width: 94px; padding: 8px 14px; }
.manager-follow-up-entry { padding: 14px 0; border-top: 1px solid #eeeef1; }
.manager-follow-up-body > *, .manager-follow-up-entry { min-width: 0; }
.manager-follow-up-entry:first-child { border-top: 0; }
.manager-follow-up-entry-heading { display: flex; justify-content: space-between; gap: 12px; }
.manager-follow-up-entry-heading span { color: #777782; }
.manager-follow-up-entry-heading { flex-wrap: wrap; font-size: 13px; font-weight: 400; }
.manager-follow-up-entry-created { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.manager-follow-up-history-grade { color: #3f3f46; font-size: 13px; font-weight: 700; }
.manager-follow-up-history-star { color: #e9a300; font-size: 15px; line-height: 1; }
.manager-follow-up-entry-heading .manager-follow-up-history-star { color: #e9a300; }
.manager-follow-up-attribution { color: var(--control-muted); font-size: 13px; font-weight: 400; }
.manager-follow-up-entry p { margin: 9px 0; color: #656575; white-space: pre-wrap; overflow-wrap: anywhere; }
.manager-follow-up-note.is-cancelled { text-decoration: line-through; }
.manager-follow-up-entry .manager-follow-up-note.is-edited { color: #3f3f46; font-weight: 600; }
.manager-follow-up-entry .manager-follow-up-note.is-edited strong { font-weight: 600; }
.manager-follow-up-entry .manager-follow-up-previous { margin: 0 0 9px; color: #8e8e93; font-size: 13px; font-weight: 400; }
.manager-follow-up-inline-edit { display: grid; gap: 10px; padding-top: 12px; }
.manager-follow-up-empty { margin: 0; padding: 24px; color: #777782; text-align: center; }
@media (max-width: 620px) { #manager-follow-up-dialog .dialog-header { padding: 18px; } .manager-follow-up-body { padding: 18px; } #manager-follow-up-owner { margin-left: 0; width: 100%; } }
#admin-followup-batch-stop:not(:disabled) { color: var(--control-accent); }
@media (max-width: 1060px) { .admin-followup-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); } .admin-followup-filter-actions { justify-content: flex-start; } }
@media (max-width: 620px) { .admin-followup-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-followup-filter-actions { grid-column: 1 / -1; } }

.provider-card,
.asset-review-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.provider-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

.provider-card small {
    display: block;
    max-width: 560px;
    margin-top: 5px;
    overflow: hidden;
    color: var(--ink-400);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-provider-badge {
    padding: 3px 8px;
    border-radius: 999px;
    background: #e8f8f0;
    color: var(--pine-700);
    font-size: 12px;
    font-weight: 800;
}

.admin-card-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.admin-action {
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--ink-700);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.admin-action-primary {
    border-color: var(--pine-600);
    background: var(--pine-600);
    color: #fff;
}

.admin-action-danger {
    border-color: #e5bbb8;
    color: var(--danger);
}

.admin-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.model-switcher.is-readonly select {
    pointer-events: none;
    cursor: default;
    opacity: 1;
}

.asset-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.asset-review-card {
    align-items: flex-end;
    flex-direction: column;
}

.asset-review-copy {
    width: 100%;
}

.asset-review-copy strong {
    display: block;
    margin-top: 8px;
    color: var(--pine-700);
    font-size: 13px;
}

.usage-summary {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--wecom-blue-soft, var(--control-accent-soft));
    color: var(--wecom-blue-dark, #1568d8);
    font-weight: 800;
}

.usage-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.usage-hero { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9fc; }
.usage-daily-limit { justify-self: start; align-self: end; color: var(--ink-700); font-size: 13px; font-weight: 700; }
.usage-balance { display: flex; align-items: baseline; gap: 8px; }
.usage-balance span { color: var(--ink-700); font-weight: 700; }
.usage-balance strong { font-size: clamp(28px, 4vw, 42px); line-height: 1; letter-spacing: -0.03em; }
.usage-balance small { color: var(--ink-500); font-size: 12px; }
.usage-quick-actions { display: flex; justify-self: end; gap: 8px; }
.usage-quick-actions button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--sales-blue-700); font: inherit; font-weight: 700; cursor: pointer; }
.usage-quick-actions button[aria-expanded="true"] { background: var(--sales-blue-50); border-color: var(--sales-blue-500); }
.usage-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 2px 14px; color: var(--ink-500); font-size: 12px; }
#usage-referrer { margin-left: auto; }
.member-role-help { margin: 0; color: #6e6574; font-size: 12px; line-height: 1.55; }
#usage-quick-actions[hidden] { display: none; }
.usage-modal { width: min(430px, calc(100vw - 32px)); max-width: none; padding: 0; border: 1px solid #d9d9df; border-radius: 18px; background: #fff; color: #1d1d1f; box-shadow: 0 24px 72px rgb(0 0 0 / 20%); }
#product-sku-dialog { width: min(800px, calc(100vw - 32px)); max-height: min(90dvh, 760px); overflow-y: auto; }
#product-sku-dialog .usage-modal-form { min-height: 410px; align-content: start; }
#product-sku-dialog .usage-modal-form textarea { width: 100%; min-height: 190px; padding: 11px 12px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; color: #1d1d1f; font: inherit; font-size: 14px; line-height: 1.55; resize: vertical; }
.usage-modal::backdrop { background: rgb(20 24 31 / 36%); backdrop-filter: blur(3px); }
.usage-modal-heading { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid #e5e5ea; }
.usage-modal-heading h2 { margin: 0; font-size: 17px; font-weight: 650; }
.usage-modal-heading button { width: 30px; height: 30px; border: 0; border-radius: 9px; background: #f5f5f7; color: #6e6e73; font-size: 20px; cursor: pointer; }
.usage-modal-form { display: grid; gap: 12px; padding: 20px; }
.usage-modal-form label { display: grid; gap: 7px; color: #6e6e73; font-size: 12px; font-weight: 600; }
.usage-modal-form input, .usage-modal-form select { width: 100%; min-height: 38px; border: 1px solid #d2d2d7; border-radius: 10px; padding: 0 11px; background: #fff; color: #1d1d1f; font: inherit; font-size: 14px; }
.usage-modal-form p { margin: 0; font-size: 13px; }
.usage-modal-form small, .usage-refund-note { color: #86868b; font-size: 12px; line-height: 1.5; }
#tenant-refund-dialog { width: min(520px, calc(100vw - 32px)); }
#tenant-refund-dialog > p { margin: 14px 20px 10px; color: #6e6e73; font-size: 13px; line-height: 1.5; }
#refund-orders, #refund-history { display: grid; gap: 7px; max-height: 200px; overflow-y: auto; margin: 0 20px; }
#refund-orders > p { color: #86868b; font-size: 13px; }
.refund-order-choice { display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 10px 12px; border: 1px solid #e5e5ea; border-radius: 10px; color: #3a3a3c; font-size: 12px; line-height: 1.5; cursor: pointer; overflow-wrap: anywhere; }
.refund-order-choice:has(input:checked) { border-color: var(--control-accent); background: var(--control-accent-soft); }
.refund-order-choice input { flex: none; margin: 2px 0 0; accent-color: var(--control-accent); }
.refund-order-choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
#refund-status { min-height: 18px; margin: 0 20px 10px; color: #3a3a3c; font-size: 12px; }
#refund-history { margin-bottom: 20px; }
.refund-history-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #e5e5ea; color: #6e6e73; font-size: 12px; }
.usage-warning-banner { margin: 10px 2px; padding: 10px 13px; border: 1px solid #f0d9a8; border-radius: 12px; background: #fff9ed; color: #805514; font-size: 12px; line-height: 1.5; }
.usage-warning-banner[hidden] { display: none; }
.usage-modal-form .usage-warning-checkbox { display: flex; align-items: center; gap: 9px; margin-top: 3px; padding: 12px 14px; border: 1px solid #e5e5ea; border-radius: 12px; background: #f9f9fb; color: #48484a; font-size: 13px; cursor: pointer; }
.usage-modal-form .usage-warning-checkbox input { width: 17px; min-height: 17px; height: 17px; margin: 0; padding: 0; accent-color: #8f59ce; }
.usage-modal-form [hidden] { display: none; }
.usage-warning-body { display: grid; gap: 12px; padding: 20px; }
.usage-warning-body p { margin: 0; color: #1d1d1f; font-size: 14px; line-height: 1.6; }
.usage-warning-body small { color: #86868b; font-size: 12px; }
.usage-warning-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.usage-warning-actions button { min-height: 36px; padding: 0 14px; border: 1px solid #d2d2d7; border-radius: 10px; background: #f5f5f7; color: #1d1d1f; cursor: pointer; }
.usage-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.usage-modal-actions button { min-height: 38px; padding: 0 15px; border-radius: 10px; }
#product-sku-delete-dialog { width: min(448px, calc(100vw - 32px)); border-color: #e5e5ea; border-radius: 22px; box-shadow: 0 24px 64px rgb(22 22 26 / 18%), 0 4px 16px rgb(22 22 26 / 6%); }
#product-sku-delete-dialog .usage-modal-heading { min-height: 58px; padding: 12px 22px 10px; border-bottom-color: #ececf0; }
#product-sku-delete-dialog .usage-modal-heading h2 { font-size: 18px; font-weight: 650; line-height: 1.3; }
#product-sku-delete-close { display: grid; place-items: center; flex: none; width: 32px; min-height: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: #f5f5f7; color: #6e6e73; cursor: pointer; }
#product-sku-delete-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
#product-sku-delete-close:hover { background: #ebebef; color: #1d1d1f; }
#product-sku-delete-close:focus-visible { outline: 3px solid rgb(140 86 201 / 34%); outline-offset: 2px; }
#product-sku-delete-dialog > p { margin: 20px 24px 24px; color: #48484a; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
#product-sku-delete-dialog .usage-modal-actions { gap: 10px; padding: 0 24px 24px; }
#product-sku-delete-dialog .usage-modal-actions button { min-width: 84px; min-height: 40px; }
.usage-warning-actions .primary-button { border-color: var(--control-accent); background: var(--control-accent); color: #fff; }
.usage-warning-actions button[hidden] { display: none; }
#recharge-preview { font-weight: 650; color: #1d1d1f; }
#recharge-checkout { display: grid; justify-items: center; gap: 10px; padding: 0 20px 20px; }
#recharge-checkout:empty { display: none; }
@media (max-width: 620px) { .usage-hero { grid-template-columns: auto minmax(0,1fr); gap: 12px; } .usage-quick-actions { grid-column: 1 / -1; justify-self: end; } .usage-daily-limit { justify-self: start; } #usage-referrer { margin-left: 0; } }
.usage-filter { margin-top: 0; padding: 4px 0 4px; border-top: 0; }
.usage-filter label { gap: 4px; color: #6e6e73; font-size: 12px; font-weight: 500; }
.usage-filter input[type="date"] { min-height: 34px; font-size: 12px; font-weight: 500; letter-spacing: 0; }
.usage-batch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usage-list-footer { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--ink-600); font-size: 13px; }
.usage-list-footer[hidden] { display: none; }
.usage-list-footer label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.usage-batch-actions[hidden], #usage-admin-summary[hidden], #sales-self-account[hidden], .admin-section-heading[hidden], .admin-tabs button[hidden] { display: none; }
.sales-self-form { max-width: 760px; }
.sales-self-identity { display: flex; flex-direction: column; gap: 8px; align-self: center; }
.sales-self-identity strong { font-size: 16px; font-weight: 400; color: #45434a; }
.sales-self-form input:disabled, .sales-self-form select:disabled { color: #86868b; background: #f5f5f7; cursor: not-allowed; }
.sales-self-form .member-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.usage-readonly-limits { color: #6e6e73; line-height: 1.5; }
.usage-readonly-limits span { display: block; }

.sales-style-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; margin: 12px 0; }
.sales-style-choice { position: relative; min-width: 0; border: 1px solid #e5e5ea; border-radius: 15px; background: #fff; }
.sales-style-choice:has(input:checked) { border-color: #1677ff; background: var(--control-accent-soft); }
.sales-style-option { display: flex !important; align-items: flex-start; gap: 10px; padding: 15px 42px 15px 14px; cursor: pointer; }
.sales-style-option input { width: 18px !important; min-width: 18px; height: 18px; flex: none; accent-color: #1677ff; }
.sales-style-option span { display: grid; gap: 7px; min-width: 0; overflow-wrap: anywhere; }
.sales-style-option small { color: #6e6e73; font-size: 12px; font-weight: 450; line-height: 1.5; }
.sales-style-option small:first-of-type { color: #303036; font-weight: 550; }
.sales-style-primary { position: absolute; top: 6px; right: 7px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #8a98ac; cursor: pointer; }
.sales-style-primary[aria-pressed="true"] { color: #e9a300; }
.sales-style-primary:hover, .sales-style-primary:focus-visible { background: #e6efff; outline-color: #1677ff; }
#personal-style-form, #tenant-style-form { margin-top: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.sales-style-choice:has(input:disabled) { opacity: .62; }
.sales-style-choice :disabled { cursor: not-allowed; }
.style-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 6px; }
.style-footer-copy { display: grid; gap: 4px; min-width: 0; }
.style-footer #style-effective-hint { margin: 0 2px; }
#style-save-status { min-height: 19px; margin: 0 2px; color: var(--ink-600); font-size: 12px; }
#style-save-status:empty { display: none; }
.style-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 0 0 0 auto; }
.style-actions button { min-width: 72px; }
@media (max-width: 620px) { .style-footer { flex-wrap: wrap; } .style-actions { width: 100%; margin-left: 0; } }

.usage-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}

.usage-table th,
.usage-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.usage-table th {
    background: var(--paper-soft);
    color: var(--ink-600);
}
.usage-limit-controls { display: flex; align-items: center; gap: 8px; min-width: max-content; }
.usage-limit-controls[hidden] {display:none;}
.usage-limit-summary {display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; color:var(--ink-600); font-size:12px;}
#tenant-usage-table .usage-limit-summary .usage-limit-edit {padding:2px 3px; min-height:26px; border:0; background:transparent; color:var(--control-accent); box-shadow:none; font-weight:500;}
#tenant-usage-table .usage-limit-summary .usage-limit-edit:hover {background:transparent; text-decoration:underline;}
.usage-limit-controls:not([hidden]) {margin-top:8px;}
.sales-account-actions {margin-bottom:18px;}
.sales-account-card {display:grid; gap:22px; padding:24px; border:1px solid var(--line); border-radius:18px; background:var(--paper);}
.sales-self-details {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px;}
.sales-password-row {display:flex; align-items:center; gap:16px; min-height:56px; border-top:1px solid var(--line); border-bottom:1px solid var(--line);}
.sales-password-row>span:first-child {min-width:64px; color:var(--ink-900); font-weight:600;}
#sales-self-password-mask {letter-spacing:3px; color:#6e6e73; font-size:18px;}
.sales-password-row button {margin-left:auto;}
.sales-account-card .sales-self-form {display:flex;align-items:end;gap:16px;max-width:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;}
.sales-account-card .sales-self-form label {flex:1;max-width:650px;}
.sales-account-card .sales-self-form .member-form-actions {flex:none;margin:0;}
@media (max-width:620px) {.sales-account-card .sales-self-form {flex-wrap:wrap;}.sales-account-card .sales-self-form label {max-width:none;min-width:100%;}}
.sales-account-card #self-password-status:empty {display:none;}
.sales-account-grid {grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:24px 32px;}
.sales-account-grid .sales-self-details {display:block;min-width:0;}
.sales-account-grid .sales-self-identity {align-self:start;}
.sales-account-grid .sales-password-row {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px;border:0;margin:0;min-width:0;}
.sales-account-grid .sales-password-row>span:first-child {grid-column:1/-1;font-weight:400;}
.sales-account-grid #sales-self-password-mask {min-height:44px;display:flex;align-items:center;}
.sales-account-grid .sales-password-row button {grid-row:2;grid-column:2;}
.sales-account-grid .sales-self-identity strong,.sales-account-grid #sales-self-group {min-height:44px;display:flex;align-items:center;}
.sales-account-grid .sales-self-form {min-width:0;align-items:end;}
#admin-dialog .sales-account-grid #sales-self-form {border:0;padding:0;background:transparent;border-radius:0;box-shadow:none;}
.sales-account-grid .sales-self-form label {min-width:0;max-width:none;}
.sales-account-grid #self-password-status {grid-column:1/-1;}
.sales-account-grid #sales-self-group {font-weight:400;overflow-wrap:anywhere;}
.sales-account-grid .sales-self-identity[hidden] {display:none;}
.sales-account-grid .account-readonly-value {box-sizing:border-box;width:100%;min-height:44px;padding:10px 12px;border:1px solid #e3e3e8;border-radius:12px;background:#f5f5f7;color:#808088;font-weight:400;cursor:default;overflow-wrap:anywhere;}
.sales-account-grid #sales-self-username,.sales-account-grid #sales-self-password-mask,.sales-account-grid #sales-self-group {color:#808088;}
@media (max-width:620px) {.sales-account-grid .sales-self-form {flex-wrap:wrap;}.sales-account-grid .sales-self-form label {min-width:0;}.sales-account-grid .sales-self-form .member-form-actions {width:100%;justify-content:flex-start;}}
@media (max-width:420px) {.sales-account-grid {gap:20px 16px;padding:18px;}.sales-account-grid .sales-password-row {flex-wrap:wrap;gap:8px;}.sales-account-grid .sales-password-row>span:first-child {min-width:0;}.sales-account-grid #sales-self-password-mask {letter-spacing:1px;font-size:14px;}}
.usage-limit-controls select { width: 96px; min-width: 96px; }
#usage-batch-form select,
#admin-dialog .usage-limit-controls select,
#tenant-limit-form select {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
}
.usage-limit-controls input[type="number"] { width: 120px; }
.usage-limit-controls .admin-action { flex: none; white-space: nowrap; }
.usage-status-cell { vertical-align: middle; min-width: 140px; }
.usage-status-cell > .usage-status-actions { display:inline-flex; vertical-align:middle; margin-right:7px; }
.usage-status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; background: #eaf7ef; color: #217647; font-size: 12px; font-weight: 700; }
.usage-status-badge[data-paused="true"] { background: #f2f2f7; color: #6e6e73; }
.usage-status-actions { display: flex; align-items: center; gap: 6px; }
.usage-status-actions .admin-action { flex: none; white-space: nowrap; }
.usage-status-actions .usage-playback-toggle { display: inline-grid; place-items: center; width: 32px; min-width: 32px; height: 30px; min-height: 30px; padding: 0; border-radius: 9px; color: var(--control-accent); font-size: 14px; line-height: 1; }
.usage-status-actions .usage-playback-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.usage-status-actions .usage-playback-toggle[aria-pressed="false"] { color: #2a8b50; }

.admin-empty {
    margin: 0;
    padding: 20px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    color: var(--ink-600);
    text-align: center;
}

@media (max-width: 760px) {
    #admin-dialog {
        width: calc(100vw - 18px);
    }
    .admin-header,
    .admin-body {
        padding-inline: 15px;
    }
    .admin-tabs {
        padding-inline: 12px;
        overflow-x: auto;
    }
    .provider-form,
    .asset-review-grid {
        grid-template-columns: 1fr;
    }
    .grading-dimension-row, .grading-thresholds { grid-template-columns: 1fr; }
    .provider-wide,
    .provider-security-note {
        grid-column: auto;
    }
    .provider-card {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    #tenant-followups .admin-data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #tenant-followups .admin-data-table tbody { display: grid; }
    #tenant-followups .admin-followup-record-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
    #tenant-followups .admin-data-table .admin-followup-record-row td { display: block; width: auto; min-width: 0; border: 0; padding: 8px 12px; text-align: left; }
    #tenant-followups .admin-followup-record-row td::before { display: block; margin-bottom: 4px; color: #777782; font-size: 11px; content: attr(data-label); }
    #tenant-followups .admin-followup-record-row td:nth-child(7) { grid-column: 1 / -1; }
    #tenant-followups .admin-followup-record-row td:last-child { grid-column: 1 / -1; text-align: right; }
    #tenant-followups .admin-followup-record-row td:last-child::before { display: none; }
}

/* 设置内打开的详情、聊天、回访和额度弹窗共用清晰背景，不再模糊/压暗。 */
#admin-dialog::backdrop,
#follow-up-dialog::backdrop,
#manager-follow-up-dialog::backdrop,
#chat-history-dialog::backdrop,
#chat-delete-dialog::backdrop,
#provider-settings-dialog::backdrop,
.usage-modal::backdrop {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.follow-up-form.is-stopped > :not(#follow-up-restore-customer) { display: none; }
.follow-up-form.is-stopped #follow-up-restore-customer { display: block; width: 100%; }

.manager-follow-up-customer-row { display: flex; align-items: center; gap: 6px; }
.manager-follow-up-customer-row p { margin: 0; }

.dialog-header .admin-window-button,
.dialog-header [data-minimize-window],
.dialog-header [data-close-dialog],
.dialog-header [data-close-video],
.dialog-header [data-manager-close] { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 10px; background: transparent !important; color: #686871; }
.dialog-header .admin-window-button:hover, .dialog-header [data-minimize-window]:hover, .dialog-header [data-close-dialog]:hover, .dialog-header [data-close-video]:hover, .dialog-header [data-manager-close]:hover,
.dialog-header .admin-window-button:focus-visible, .dialog-header [data-minimize-window]:focus-visible, .dialog-header [data-close-dialog]:focus-visible, .dialog-header [data-close-video]:focus-visible, .dialog-header [data-manager-close]:focus-visible { background: #f2eafa !important; color: #673899 !important; }

.manager-follow-up-dialog .dialog-header > div:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.manager-follow-up-dialog #manager-follow-up-title { margin: 0; white-space: nowrap; }
.manager-follow-up-customer-row { min-width: 0; }
.manager-follow-up-customer-row p { max-width: 36vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-header .admin-window-button, .admin-header #close-admin-dialog { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 10px; background: transparent !important; color: #686871; }
.admin-header .admin-window-button:hover, .admin-header #close-admin-dialog:hover, .admin-header .admin-window-button:focus-visible, .admin-header #close-admin-dialog:focus-visible { background: #f2eafa !important; color: #673899 !important; }

@media (min-width: 621px) {
  .outcomes-filters > label { white-space: nowrap; }
  .outcomes-filters select { min-width: 148px; white-space: nowrap; }
  #outcomes-period { min-width: 156px; }
}

.follow-up-stop-info, .manager-follow-up-stop-info { margin: 10px 16px; padding: 10px 12px; border: 1px solid #eadff3; border-radius: 10px; background: #faf6ff; color: #625b69; font-size: 13px; line-height: 1.5; }
#follow-up-dialog.is-stopped .follow-up-history-actions, .manager-follow-up-dialog.is-stopped .manager-follow-up-entry-actions { display: none !important; }

.business-scope-note { margin: 0 0 14px; padding: 9px 12px; border: 1px solid #eadff3; border-radius: 9px; background: #faf6ff; color: #625b69; font-size: 13px; }
.member-business-permission { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 4px 0 10px; }
.member-business-permission small { flex-basis: 100%; color: #86868b; font-size: 12px; }
.outcomes-card { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 16px 18px; }
.outcomes-card-value { flex: none; font-size: clamp(32px, 3.4vw, 46px); font-weight: 760; line-height: 1; }
.outcomes-card-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.outcomes-card-copy .outcomes-card-label { font-size: 13px; font-weight: 650; }
.outcomes-card-copy small { font-size: 12px; line-height: 1.35; }
.outcomes-filters .outcomes-filter-actions { flex-basis: 100%; margin-inline-start: 52px; justify-content: flex-start; }
.outcomes-card-value { display: inline-flex; align-items: baseline; gap: 2px; }
.outcomes-card-unit { font-size: .52em; font-weight: 650; line-height: 1; }
.outcomes-filters select { justify-self: start; width: max-content; max-width: 100%; }
.outcomes-filters #outcomes-period { min-width: 92px; }
.outcomes-filters #outcomes-salesperson,
.outcomes-filters #outcomes-grade { min-width: 118px; }
.outcomes-filters #outcomes-basis { min-width: 92px; }
.outcomes-filters .outcomes-filter-actions { flex: 0 0 auto; flex-basis: auto; margin-inline-start: 0; }
:root {
    --dialog-header-height: 52px;
    --dialog-header-padding-x: 18px;
    --dialog-title-size: 18px;
    --dialog-window-button-size: 34px;
    --dialog-window-button-radius: 10px;
}
#admin-dialog .admin-header,
#follow-up-dialog > .dialog-header,
#manager-follow-up-dialog .dialog-header,
#chat-history-dialog .chat-history-heading,
.usage-modal .usage-modal-heading {
    min-height: var(--dialog-header-height) !important;
    padding: 0 var(--dialog-header-padding-x) !important;
    box-sizing: border-box !important;
}
#admin-dialog .admin-header h2,
#follow-up-dialog > .dialog-header h2,
#manager-follow-up-dialog .dialog-header h2,
#chat-history-dialog .chat-history-heading h2,
.usage-modal .usage-modal-heading h2 {
    margin: 0 !important;
    font-size: var(--dialog-title-size) !important;
    font-weight: 600 !important;
}
.admin-window-button,
.dialog-header [data-minimize-window],
.dialog-header [data-close-dialog],
.dialog-header [data-manager-close],
#admin-dialog #close-admin-dialog {
    width: var(--dialog-window-button-size) !important;
    min-width: var(--dialog-window-button-size) !important;
    height: var(--dialog-window-button-size) !important;
    min-height: var(--dialog-window-button-size) !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: var(--dialog-window-button-radius) !important;
    background: transparent !important;
    color: #686871 !important;
}
.admin-window-button svg,
.dialog-header [data-minimize-window] svg,
.dialog-header [data-close-dialog] svg,
.dialog-header [data-manager-close] svg,
#admin-dialog #close-admin-dialog svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}
.admin-window-button:hover,
.dialog-header [data-minimize-window]:hover,
.dialog-header [data-close-dialog]:hover,
.dialog-header [data-manager-close]:hover,
#admin-dialog #close-admin-dialog:hover {
    background: #f2eafa !important;
    color: #673899 !important;
}
.admin-followup-loading { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #673899; font-size: 13px; }
.admin-followup-loading[hidden] { display: none !important; }
.admin-loading-spinner { width: 14px; height: 14px; border: 2px solid #e6d9f2; border-top-color: #8b5cc4; border-radius: 50%; animation: admin-loading-spin .7s linear infinite; }
@keyframes admin-loading-spin { to { transform: rotate(360deg); } }
.admin-followup-loading { position: sticky; top: 0; z-index: 3; background: #fff; border-radius: 9px; }
.permission-panel { padding: 0 2px 12px; }
.permission-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 4px 0 14px; }
.permission-editor-heading h3 { margin: 0 0 4px; font-size: 18px; }
.permission-editor-heading p { margin: 0; color: var(--ink-500); font-size: 12px; }
#permission-save-status { color: var(--control-accent); font-size: 12px; white-space: nowrap; }
.permission-matrix { display: grid; gap: 14px; }
.permission-group { overflow: visible; border: 1px solid #e6dfee; border-radius: 14px; background: #fff; }
.permission-group h4 { border-radius: 13px 13px 0 0; }
.permission-group h4 { margin: 0; padding: 11px 14px; background: #faf7fd; color: #4d3566; font-size: 13px; font-weight: 700; }
.permission-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.permission-table th { padding: 8px 10px; background: #fff; color: #8a8094; font-size: 11px; font-weight: 600; text-align: center; }
.permission-table th:first-child { width: 42%; text-align: left; }
.permission-table td { padding: 9px 10px; border-top: 1px solid #f0ebf4; text-align: center; }
.permission-table td:first-child { text-align: left; }
.permission-label { color: #37313e; font-size: 12px; }
.permission-table :is(input[type="checkbox"],select) { accent-color: var(--control-accent); }
.permission-scope { max-width: 84px; min-height: 30px; padding: 3px 6px; border: 1px solid #ddd4e7; border-radius: 8px; background: #fff; color: #4d3566; font: inherit; font-size: 11px; }
.permission-toggle { width: 16px; height: 16px; }
.permission-help { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 5px; border: 1px solid #cabada; border-radius: 50%; color: #8a6ba8; font-size: 10px; line-height: 1; cursor: help; position: relative; }
.permission-help::after { content: attr(data-tooltip); position: absolute; left: 50%; top: calc(100% + 7px); bottom: auto; z-index: 300; width: max-content; max-width: 260px; padding: 7px 9px; border-radius: 8px; background: #352b40; color: #fff; font-size: 11px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; transform: translateX(-50%); opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
.permission-help:hover::after,.permission-help:focus-visible::after { opacity: 1; visibility: visible; }
.permission-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 640px) { .permission-table th:first-child { width: 38%; } .permission-table td,.permission-table th { padding: 7px 5px; } .permission-scope { max-width: 68px; } }
.permission-item { padding: 13px 14px 12px; border-top: 1px solid #f0ebf4; }
.permission-item:first-of-type { border-top: 0; }
.permission-item-heading { display: flex; align-items: center; gap: 4px; margin-bottom: 9px; color: #37313e; font-size: 12px; }
.permission-item-heading strong { font-weight: 650; }
.permission-role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.permission-role { display: grid; gap: 4px; min-width: 0; color: #8a8094; font-size: 10px; }
.permission-role > span { padding-left: 2px; }
.permission-role > select, .permission-role > input[type="checkbox"] { justify-self: stretch; }
.permission-role > select { width: 100%; max-width: none; }
.permission-role > input[type="checkbox"] { justify-self: center; margin-top: 6px; }
@media (max-width: 520px) { .permission-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.permission-legend { margin: 0 0 12px; padding: 9px 11px; border: 1px solid #eee6f6; border-radius: 10px; background: #fbf8fe; color: #6f5b82; font-size: 11px; line-height: 1.6; }
.permission-audit { margin-top: 18px; border: 1px solid #e9e3f0; border-radius: 13px; background: #fff; overflow: hidden; }
.permission-audit h4 { margin: 0; padding: 12px 16px; border-bottom: 1px solid #f0ebf5; font-size: 15px; color: #4f4758; }
.permission-audit-list { display: grid; }
.permission-audit-row { display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(90px, .7fr) minmax(170px, 1.5fr) minmax(120px, 1fr); gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f6f2fa; font-size: 12px; color: #6b6471; align-items: center; }
.permission-audit-row:last-child { border-bottom: 0; }
.permission-audit-row strong { color: #4e4658; font-weight: 600; }
.permission-audit-change { color: #7c7482; }
.permission-audit-change b { color: #5c4b8a; font-weight: 600; }
.permission-audit-list > p { margin: 0; padding: 14px 16px; color: #8b8391; font-size: 13px; }
@media (max-width: 760px) { .permission-audit-row { grid-template-columns: 1fr 1fr; } }
.permission-audit-tools { display: flex; align-items: end; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f6f2fa; }
.permission-audit-tools label { display: grid; gap: 4px; color: #7b7381; font-size: 12px; }
.permission-audit-tools select { min-width: 110px; height: 32px; border: 1px solid #e3dce9; border-radius: 8px; background: #fff; padding: 0 8px; }
.permission-audit-tools button { margin-left: auto; height: 32px; padding: 0 12px; }
/* Permission workbench */
.permission-workbench-header { display: flex; align-items: stretch; justify-content: space-between; gap: 18px; margin: 0 0 14px; padding: 20px 22px; border: 1px solid #e9e2f4; border-radius: 18px; background: radial-gradient(circle at 90% 0%, #f0e5ff 0, transparent 42%), linear-gradient(135deg, #fff 0%, #fbf8ff 100%); box-shadow: 0 10px 25px rgba(72, 45, 110, .06); overflow: hidden; }
.permission-hero-copy { min-width: 0; }
.permission-kicker { display: inline-block; margin-bottom: 5px; color: #8a6bba; font-size: 10px; font-weight: 750; letter-spacing: .18em; }
.permission-hero-copy h3 { margin: 0; color: #332a40; font-size: 23px; letter-spacing: -.02em; }
.permission-hero-copy p { max-width: 540px; margin: 6px 0 0; color: #7d7287; font-size: 12px; line-height: 1.65; }
.permission-hero-stats { display: flex; align-items: stretch; gap: 8px; flex-shrink: 0; }
.permission-stat { display: grid; align-content: center; min-width: 76px; padding: 8px 12px; border: 1px solid #eee6f7; border-radius: 12px; background: rgba(255, 255, 255, .72); text-align: center; }
.permission-stat strong { color: #5b3e83; font-size: 19px; line-height: 1.1; }
.permission-stat span { margin-top: 3px; color: #92879d; font-size: 10px; }
.permission-role-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.permission-role-tab { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 12px; border: 1px solid #e9e2f1; border-radius: 13px; background: #fff; color: #6d6278; text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.permission-role-tab:hover { transform: translateY(-1px); border-color: #cdb9e8; box-shadow: 0 7px 18px rgba(83, 55, 120, .09); }
.permission-role-tab.is-active { border-color: #bca3e2; background: linear-gradient(135deg, #fbf7ff, #f3eaff); box-shadow: 0 7px 18px rgba(83, 55, 120, .1); }
.permission-role-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 750; background: #8e72b9; }
.tone-owner .permission-role-avatar { background: linear-gradient(135deg, #d5a930, #a97916); }
.tone-admin .permission-role-avatar { background: linear-gradient(135deg, #8060c9, #51348f); }
.tone-leader .permission-role-avatar { background: linear-gradient(135deg, #3fa6a0, #267d79); }
.tone-sales .permission-role-avatar { background: linear-gradient(135deg, #5b93d6, #326ba9); }
.permission-role-copy { display: grid; min-width: 0; gap: 2px; }
.permission-role-copy strong { color: #41364d; font-size: 12px; }
.permission-role-copy small { overflow: hidden; color: #978ca3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.permission-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.permission-search-field { display: flex; align-items: center; flex: 1; gap: 7px; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid #e5dced; border-radius: 10px; background: #fff; }
.permission-search-icon { color: #a491b8; font-size: 18px; line-height: 1; }
.permission-search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #493e55; font: inherit; font-size: 12px; }
.permission-filter-button { height: 36px; padding: 0 12px; border: 1px solid #e5dced; border-radius: 10px; background: #fff; color: #766a82; font-size: 11px; cursor: pointer; transition: .2s ease; }
.permission-filter-button:hover, .permission-filter-button.is-active { border-color: #c7b0e2; background: #f5edff; color: #5d3b88; }
.permission-edit-hint { margin-left: auto; color: #9a8fa5; font-size: 11px; white-space: nowrap; }
.permission-edit-hint strong { color: #634381; font-weight: 650; }
.permission-modules { display: grid; gap: 10px; }
.permission-module { --module-accent: #7b5bb5; overflow: hidden; border: 1px solid #ebe4f1; border-radius: 15px; background: #fff; box-shadow: 0 4px 14px rgba(66, 45, 86, .035); animation: permission-rise .35s ease both; }
.permission-module[data-tone="1"] { --module-accent: #2f9a91; }
.permission-module[data-tone="2"] { --module-accent: #b27b2d; }
.permission-module[data-tone="3"] { --module-accent: #4c86bd; }
.permission-module[data-tone="4"] { --module-accent: #8b5b91; }
.permission-module:nth-child(2) { animation-delay: .04s; }
.permission-module:nth-child(3) { animation-delay: .08s; }
.permission-module:nth-child(4) { animation-delay: .12s; }
.permission-module:nth-child(5) { animation-delay: .16s; }
.permission-module-heading { display: flex; align-items: center; gap: 10px; padding: 11px 15px; background: linear-gradient(90deg, color-mix(in srgb, var(--module-accent) 9%, white), #fff 70%); }
.permission-module-glyph { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; border-radius: 9px; background: color-mix(in srgb, var(--module-accent) 13%, white); color: var(--module-accent); font-size: 15px; }
.permission-module-copy { display: grid; gap: 2px; min-width: 0; }
.permission-module-copy h4 { margin: 0; color: #403449; font-size: 13px; }
.permission-module-copy p { margin: 0; color: #9b8fa5; font-size: 10px; }
.permission-module-meter { width: 88px; height: 5px; margin-left: auto; overflow: hidden; border-radius: 99px; background: #f0eaf4; }
.permission-module-meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--module-accent); transition: width .35s ease; }
.permission-feature { display: grid; grid-template-columns: 22px minmax(180px, 1fr) minmax(190px, auto); align-items: center; gap: 11px; padding: 10px 15px; border-top: 1px solid #f4eff7; transition: background .18s ease, opacity .18s ease; }
.permission-feature:hover { background: #fcfaff; }
.permission-feature.is-off { opacity: .72; }
.permission-feature-marker { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: color-mix(in srgb, var(--module-accent) 10%, white); color: var(--module-accent); font-size: 10px; }
.permission-feature-copy { min-width: 0; }
.permission-feature-title { display: flex; align-items: center; gap: 5px; min-width: 0; }
.permission-feature-title strong { overflow: hidden; color: #4a3f54; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.permission-feature-help { overflow: hidden; margin: 3px 0 0; color: #9b909f; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.permission-segmented { display: inline-flex; justify-self: end; padding: 3px; border: 1px solid #e9e1ef; border-radius: 9px; background: #faf8fc; }
.permission-segment { min-height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: #887d92; font: inherit; font-size: 10px; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.permission-segment:hover { color: #5c3d83; }
.permission-segment.is-active { background: #fff; color: #5f3d89; box-shadow: 0 2px 7px rgba(75, 47, 108, .12); }
.permission-switch { display: inline-flex; align-items: center; justify-self: end; gap: 7px; border: 0; background: transparent; color: #9a8da4; font: inherit; font-size: 10px; cursor: pointer; }
.permission-switch-track { position: relative; display: block; width: 30px; height: 17px; border-radius: 99px; background: #e7e0eb; transition: background .2s ease; }
.permission-switch-knob { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(50, 30, 70, .2); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.permission-switch.is-on { color: #65428f; }
.permission-switch.is-on .permission-switch-track { background: #8a67b8; }
.permission-switch.is-on .permission-switch-knob { transform: translateX(13px); }
.permission-switch-label { min-width: 20px; text-align: left; }
.permission-empty-filter { margin: 0; padding: 22px; border: 1px dashed #e2d7eb; border-radius: 12px; color: #9a8fa4; font-size: 12px; text-align: center; }
@keyframes permission-rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    .permission-module, .permission-role-tab, .permission-switch-track, .permission-switch-knob, .permission-module-meter-fill { animation: none !important; transition: none !important; }
}
@media (max-width: 780px) {
    .permission-workbench-header { flex-direction: column; padding: 16px; }
    .permission-hero-stats { width: 100%; }
    .permission-stat { flex: 1; min-width: 0; }
    .permission-role-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .permission-feature { grid-template-columns: 22px minmax(0, 1fr) auto; }
    .permission-control { grid-column: 2 / -1; justify-self: start; }
    .permission-edit-hint { display: none; }
}
/* keep the permission search on one line: global label/input rules must not stretch it */
#admin-dialog .permission-search-field { display: flex !important; align-items: center !important; height: 36px; padding: 0 11px; overflow: hidden; }
#admin-dialog .permission-search-field input { display: block; width: 100%; height: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; line-height: 36px; }
.permission-editor-actions #permission-save-status { margin-right: auto; align-self: center; }
.permission-audit-tools { align-items: center; }
.permission-audit-filter-label { color: #7b7381; font-size: 12px; white-space: nowrap; }
.permission-audit-role-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #e9e1ef; border-radius: 9px; background: #faf8fc; }
.permission-audit-role { min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #887d92; font: inherit; font-size: 11px; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.permission-audit-role:hover { color: #5c3d83; }
.permission-audit-role.is-active { background: #fff; color: #5f3d89; box-shadow: 0 2px 7px rgba(75, 47, 108, .12); }
.permission-audit-role-switch .permission-audit-role { margin: 0; }
.permission-audit-tools #permission-audit-more { margin-left: auto; }
@media (max-width: 600px) { .permission-audit-tools { flex-wrap: wrap; } .permission-audit-role-switch { order: 3; width: 100%; justify-content: space-between; } }
@media (min-width: 641px) and (max-width: 780px) { .permission-role-switch { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .permission-role-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#admin-dialog .admin-body { overflow-x: hidden; }
