/* Workbench visual system. Scoped to CRM components; host messaging UI is unchanged. */
:is(.wb-modal, .wb-inline-full, .wb-workspace) {
  --wb-bg: #10171f;
  --wb-surface: #17212c;
  --wb-raised: #1c2936;
  --wb-border: #2c3c4c;
  --wb-text: #edf3f7;
  --wb-muted: #a0b0bf;
  --wb-accent: #62dbb5;
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  color: var(--wb-text);
  color-scheme: dark;
}
.wb-modal *, .wb-inline-full * { box-sizing: border-box; }
.wb-modal .wb-panel, .wb-inline-full { background: var(--wb-bg, #10171f); border-color: var(--wb-border, #2c3c4c); }
#admin-workbench-root:not(.wb-inline-full) { background: #10171f; padding: 20px; border: 1px solid #2c3c4c; border-radius: 12px; min-width: 0; }
.wb-modal .wb-panel { width: min(1480px, calc(100vw - 32px)); height: 94vh; }
.wb-modal .wb-modal-head { min-height: 58px; padding: 12px 24px; background: #141e28; border-color: #2c3c4c; }
#wb-dialog-title { font-size: 17px; letter-spacing: -.4px; color: #edf3f7; }
#wb-dialog-title::before { content: ''; display: inline-block; width: 10px; height: 10px; background: #62dbb5; border-radius: 3px; margin-right: 10px; }
#wb-dialog-title small { font-weight: 400; font-size: 12px; color: #a0b0bf; margin-left: 16px; letter-spacing: 0; }
.wb-x, .wb-max { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid #344455; border-radius: 8px; background: transparent; color: #bdcad5; }
.wb-x:hover, .wb-max:hover { background: #243442; color: #fff; }
.wb-modal.wb-full .wb-modal-body { padding: 20px 24px 16px; }
.wb-top { gap: 14px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid #2c3c4c; }
.wb-tabs { gap: 4px; padding: 4px; background: #0b1219; border: 1px solid #293846; border-radius: 10px; }
.wb-tab { border: 0; background: transparent; color: #a0b0bf; font-size: 12px; padding: 9px 14px; border-radius: 7px; }
.wb-tab:hover { background: #1c2936; color: #edf3f7; }
.wb-tab.on { background: #243846; color: #b6f5df; box-shadow: inset 0 0 0 1px #44615c; }
.wb-top-right { gap: 6px; }
.wb-modal button, .wb-workspace button { font-family: inherit; }
.wb-btn { min-height: 34px; border-radius: 7px; background: #62dbb5; color: #10251e; padding: 8px 12px; font-size: 12px; }
.wb-btn:hover { background: #89e9cb; }
.wb-btn-ghost { background: #17212c; color: #c3d0dc; border: 1px solid #344455; font-weight: 500; }
.wb-btn-ghost:hover { background: #233442; color: #fff; border-color: #657e90; }
.wb-btn:disabled { opacity: .45; cursor: not-allowed; }
.wb-btn[aria-pressed="true"] { background: #1b3b34; color: #b6f5df; border-color: #438e79; }
.wb-tools .wb-btn[aria-pressed="true"], .wb-tools #wb-wrap[aria-pressed="true"] { background: #1b3b34; color: #b6f5df; border-color: #438e79; }
.wb-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.wb-eyebrow { font-size: 10px; letter-spacing: .14em; color: #62dbb5; text-transform: uppercase; font-weight: 700; }
.wb-intro h2 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.7px; margin: 7px 0; color: #edf3f7; }
.wb-intro p { margin: 0; font-size: 12px; line-height: 1.6; color: #a0b0bf; }
.wb-workspace-tag { border: 1px solid #344455; border-radius: 20px; padding: 6px 12px; color: #a0b0bf; font-size: 11px; white-space: nowrap; }
.wb-cards { gap: 10px; margin-bottom: 18px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.wb-card { border-radius: 9px; background: #17212c; border-color: #2c3c4c; padding: 14px; }
.wb-card-l { font-size: 10px; letter-spacing: .06em; color: #a0b0bf; }
.wb-card-v { font-size: 23px; font-weight: 600; color: #edf3f7; margin-top: 9px; font-variant-numeric: tabular-nums; }
.wb-card-big { background: #1b332e; border-color: #3c7464; }
.wb-card-big .wb-card-v { font-size: 25px; color: #8aebcb; }
.wb-card-v.pos, .wb-mini .pos { color: #7de2bd; }
.wb-card-v.neg, .wb-mini .neg { color: #ffa4b4; }
.wb-lead-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wb-disclosure { border: 1px solid #2c3c4c; border-radius: 8px; margin-bottom: 10px; background: #151f29; font-size: 12px; }
.wb-disclosure summary { padding: 11px 14px; color: #d6e2eb; cursor: pointer; font-weight: 600; }
.wb-disclosure summary span { margin-left: 14px; font-weight: 400; color: #a0b0bf; font-size: 11px; }
.wb-disclosure > .wb-att-settings, .wb-disclosure > .wb-byuser { margin: 0; padding: 12px 14px; border-top: 1px solid #2c3c4c; overflow: auto; }
.wb-mini { min-width: 780px; }
.wb-mini th { color: #a0b0bf; padding: 9px; }
.wb-mini td { color: #d6e2eb; padding: 9px; border-color: #2c3c4c; }
.wb-tools { padding: 12px; gap: 8px; border: 1px solid #2c3c4c; background: #17212c; border-radius: 10px; margin: 6px 0 10px; }
.wb-inp { min-height: 34px; background: #10171f; border-color: #344455; color: #edf3f7; border-radius: 6px; }
.wb-inp::placeholder { color: #92a4b5; }
.wb-inp:focus { border-color: #62dbb5; box-shadow: 0 0 0 2px #62dbb51a; }
#wb-q, #wb-sq { min-width: 200px; flex: 1 1 200px; }
.wb-tools .wb-record-count { color: #bfd0dd; font-size: 11px; padding: 0 6px; }
.wb-tools .wb-scroll-hint { color: #a0b0bf; font-size: 10px; }
.wb-cell-preview { border-color: #2c3c4c; background: #131d27; border-radius: 7px; color: #d6e2eb; min-height: 38px; }
.wb-cell-preview b { color: #a0b0bf; font-size: 11px; min-width: 120px; }
.wb-gridwrap { background: #131c26; border-color: #344455; border-radius: 9px; scrollbar-color: #617989 #17212c; }
.wb-gridwrap::-webkit-scrollbar-thumb { background: #617989; border-color: #17212c; }
.wb-gridwrap::-webkit-scrollbar-track { background: #17212c; }
.wb-grid { color: #d6e2eb; font-size: 12px; }
.wb-grid thead th { background: #22313f; color: #c9d7e3; border-color: #3b4e60; font-size: 10px; letter-spacing: .035em; padding: 12px; }
.wb-grid td.cell, .wb-grid tbody td:not(.cell) { border-color: #293a49; padding: 10px 12px; color: #d6e2eb; }
.wb-grid td.cell { max-width: none; }
.wb-grid thead th { overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
.wb-col-resize { position: absolute; top: 0; bottom: 0; right: 0; width: 10px; padding: 0;
  border: 0; border-right: 2px solid transparent; background: transparent; cursor: col-resize; touch-action: none; }
.wb-col-resize:hover, .wb-col-resize:focus-visible { border-right-color: #62dbb5; background: #62dbb51a; }
.wb-empty-row td { padding: 36px 24px !important; text-align: left; color: #c9d7e3; }
.wb-empty-row strong { font-size: 15px; }
.wb-empty-row p { color: #a0b0bf; margin: 8px 0 0; font-size: 12px; }
.wb-loading { padding: 48px 24px; border: 1px solid #344455; border-radius: 12px; background: #17212c; }
.wb-loading h2 { color: #edf3f7; font-size: 24px; margin: 12px 0; }
.wb-loading p { color: #a0b0bf; font-size: 13px; margin: 12px 0; }
.wb-grid tbody tr:nth-child(even) td.cell { background: #172330; }
.wb-grid tbody tr:hover td.cell { background: #20323d; }
.wb-grid .rownum, .wb-grid .rowact { background: #182531; color: #a0b0bf; border-color: #3b4e60; }
.wb-grid .rowact { min-width: 210px; white-space: nowrap; }
.wb-workspace[data-sheet="log"] .wb-grid .rowact { min-width: 80px; }
.wb-grid thead .rownum, .wb-grid thead .rowact { background: #22313f; }
.wb-grid td.cell.sel { outline-color: #62dbb5; background: #21483d !important; }
.wb-grid td.cell.selrange { background: #234039 !important; }
.wb-grid .cell.editing { padding: 0; }
.wb-grid td.t-money, .wb-grid td.t-count { font-variant-numeric: tabular-nums; }
.wb-grid td.t-money { color: #8ce8c6; }
.wb-grid td.t-money.neg { color: #ffa4b4; }
.wb-grid tfoot .wb-tot td { background: #203d36; border-color: #3a6357; color: #baf3dc; padding: 11px 12px; }
.wb-edit-inp { background: #234537; color: #fff; padding: 10px 12px; box-shadow: inset 0 0 0 2px #62dbb5; }
.wb-edit-bar { background: #1c3b33; color: #c7e9dc; border-color: #438e79; }
.wb-ghost td { color: #91b9a9 !important; padding: 13px 12px !important; }
.wb-ghost:hover td { background: #203d36 !important; }
.wb-assign-sel, .wb-country-sel { background: #17212c; color: #d6e2eb; border-color: #405467; min-height: 30px; max-width: 100%; }
.wb-mini-btn, .wb-del { min-height: 30px; min-width: 30px; color: #b0cad9; }
.wb-mini-btn:hover { background: #29413f; }
.wb-del:hover { color: #ffadbb; background: #512a34; }
.wb-foot { color: #9bafbf; font-size: 11px; padding: 8px 0 0; line-height: 1.7; }
.wb-foot b { color: #d6e2eb; }
.wb-saved { color: #8ce8c6; font-size: 11px; }
.wb-saved.busy { color: #f4d68c; }
.wb-scripts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.wb-script-card { background: #17212c; border-color: #344455; padding: 18px; border-radius: 11px; gap: 12px; }
.wb-script-title { font-size: 15px; color: #edf3f7; }
.wb-script-meta { color: #a0b0bf; line-height: 1.5; }
.wb-script-body { padding: 14px; background: #10171f; color: #c9d7e3; line-height: 1.8; max-height: 260px; overflow: auto; }
.wb-script-foot { border-top: 1px solid #2c3c4c; padding-top: 12px; }
.wb-scripts-empty { border-color: #3b4e60; color: #b0c1cf; background: #151f29; padding: 40px 22px; }
.wb-script-editor, .wb-team-panel, .wb-notif-panel, .wb-chat-panel { background: #17212c; border-color: #3b4e60; border-radius: 10px; padding: 16px; }
.wb-script-editor textarea, .wb-chat-input textarea { background: #10171f; color: #edf3f7; border-color: #405467; }
.wb-chat-msgs, .wb-team-card { background: #10171f; border-color: #2c3c4c; }
.wb-chat-bubble { background: #263746; border-color: #405467; color: #edf3f7; }
.wb-chat-msg.own .wb-chat-bubble { background: #21483d; border-color: #438e79; }
.wb-chat-head, .wb-files-head, .wb-files-ro { color: #d6e2eb; }
.wb-chat-meta, .wb-chat-sub, .wb-notif-meta { color: #a0b0bf; }
.wb-files-row td { background: #151f29 !important; border-color: #3b4e60; }
.wb-paste { background: #10171f; border-color: #405467; color: #a0b0bf; padding: 22px; }
.wb-paste:hover, .wb-paste:focus, .wb-paste.over { background: #1c342e; border-color: #62dbb5; }
.wb-notif-item { color: #d6e2eb; border-color: #2c3c4c; padding: 12px 8px; }
.wb-notif-item.unread { background: #1b332e; }
.wb-team-table th, .wb-team-table td { border-color: #344455; padding: 10px; }
.wb-team-table th { color: #a0b0bf; }
.wb-team-table td { color: #d6e2eb; }
.wb-att-settings { border-color: #344455; }
.wb-att-settings label, .wb-clock-totals { color: #a0b0bf; }
.wb-att-settings input, .att-btn { background: #17212c; color: #d6e2eb; border-color: #405467; }
.wb-focus .wb-cards, .wb-focus .wb-intro, .wb-focus .wb-disclosure { display: none; }
.wb-compact .wb-grid td.cell, .wb-compact .wb-grid tbody td:not(.cell) { padding: 5px 9px; font-size: 11px; }
.wb-compact .wb-grid .cell.editing { padding: 0; }
:is(.wb-modal, .wb-inline-full) :is(button, summary, input, select, textarea):focus-visible { outline: 2px solid #62dbb5; outline-offset: 3px; }
@media (max-width: 900px) {
  .wb-top-right { flex: 1 1 100%; }
  .wb-intro h2 { font-size: 23px; }
  .wb-workspace-tag { display: none; }
  .wb-lead-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wb-grid .rowact { position: static; }
  .wb-modal.wb-full .wb-modal-body { padding: 12px 10px; }
  .wb-modal .wb-modal-head { padding: 10px; }
  #wb-dialog-title small { display: none; }
  .wb-top { margin-bottom: 14px; padding-bottom: 12px; }
  .wb-tabs { width: 100%; }
  .wb-tab { flex: 1; padding: 9px 8px; }
  .wb-card { padding: 12px; }
  .wb-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .wb-lead-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wb-lead-overview .wb-card { padding: 8px; }
  .wb-lead-overview .wb-card-l { font-size: 8px; min-height: 22px; }
  .wb-lead-overview .wb-card-v { font-size: 20px; margin-top: 3px; }
  .wb-intro { margin-bottom: 12px; }
  .wb-intro p, .wb-eyebrow { display: none; }
  .wb-intro h2 { font-size: 20px; margin: 0; }
  .wb-tools { padding: 9px; gap: 6px; }
  .wb-tools .wb-scroll-hint { display: none; }
  .wb-top-right .wb-btn { padding: 7px 9px; }
  .wb-top-right .wb-saved { margin-left: auto; }
  .wb-disclosure summary span { display: block; margin: 5px 0 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .wb-modal *, .wb-toast { transition: none !important; scroll-behavior: auto !important; }
}
