/* Team work system (owner request, 6 Nov 2026). Uses the workspace tokens, light and dark. */
.tm-tabs{display:flex;gap:4px;margin:0 0 18px;padding:4px;border:1px solid var(--line,#e4eaf1);border-radius:10px;background:var(--theme-raised,#f4f6f8);width:max-content;max-width:100%;overflow-x:auto}
.tm-tabs button{padding:9px 18px;border-radius:7px;font-weight:600;color:var(--muted,#6f7b8e);white-space:nowrap}
.tm-tabs button.active{background:var(--theme-panel,#fff);color:var(--accent,#34736a);box-shadow:0 1px 4px #0000001a}
.tm-panel{display:flex;flex-direction:column;gap:18px;max-width:980px}
.tm-head h2{font-size:20px;margin-bottom:4px}.tm-head p{color:var(--muted,#6f7b8e)}
.tm-cards{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.tm-card{position:relative;display:flex;align-items:flex-start;gap:12px;padding:18px;border:1.5px solid var(--line,#e4eaf1);border-radius:12px;background:var(--theme-panel,#fff);cursor:pointer;transition:border-color .15s,box-shadow .15s}
.tm-card:hover{border-color:color-mix(in srgb,var(--accent,#34736a) 45%,var(--line,#e4eaf1))}
.tm-card.selected{border-color:var(--accent,#34736a);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent,#34736a) 16%,transparent);background:color-mix(in srgb,var(--accent-soft,#eaf3f0) 55%,var(--theme-panel,#fff))}
.tm-card input,.tm-method input{position:absolute;opacity:0;pointer-events:none}
.tm-radio{flex:none;width:20px;height:20px;margin-top:2px;border:2px solid var(--muted,#8a95a6);border-radius:50%;display:grid;place-items:center}
.tm-card.selected .tm-radio,.tm-method.selected::before{border-color:var(--accent,#34736a)}
.tm-card.selected .tm-radio::after{content:'';width:10px;height:10px;border-radius:50%;background:var(--accent,#34736a)}
.tm-card input:focus-visible+.tm-radio,.tm-method input:focus-visible+span{outline:2px solid #538cff;outline-offset:3px}
.tm-card-body{display:flex;flex-direction:column;gap:6px;min-width:0}.tm-card-body b{font-size:16px}.tm-card-body small{font-size:13px;line-height:1.8}
.tm-current{position:absolute;top:12px;left:12px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:20px;background:var(--accent-soft,#eaf3f0);color:var(--accent,#34736a)}
.tm-settings{display:flex;flex-direction:column;gap:16px;padding:20px;border:1px solid var(--line,#e4eaf1);border-radius:12px;background:var(--theme-panel,#fff)}
.tm-settings h3,.tm-section h3{font-size:16px}.tm-settings p{color:var(--muted,#6f7b8e);line-height:1.8}
.tm-settings>.outline-button{align-self:flex-start}
.tm-methods{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.tm-methods legend{font-weight:600;margin-bottom:8px;padding:0}
.tm-method{position:relative;display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1px solid var(--line,#e4eaf1);border-radius:10px;cursor:pointer}
.tm-method::before{content:'';flex:none;width:16px;height:16px;margin-top:3px;border:2px solid var(--muted,#8a95a6);border-radius:50%;box-sizing:border-box}
.tm-method.selected{border-color:var(--accent,#34736a);background:color-mix(in srgb,var(--accent-soft,#eaf3f0) 60%,transparent)}
.tm-method.selected::before{border-width:5px}
.tm-method span{display:flex;flex-direction:column;gap:3px}.tm-method small{font-size:12.5px}
.tm-amount{display:flex;flex-direction:column;gap:6px;font-weight:600}.tm-amount small{font-weight:400}
.tm-money{display:flex;align-items:center;gap:8px;max-width:260px}.tm-money input{flex:1;min-width:0;font-size:16px;font-weight:600;direction:ltr;text-align:right}
.tm-money span{font-weight:600;color:var(--muted,#6f7b8e)}
.tm-eligible{display:flex;flex-direction:column;gap:8px;padding:14px;border-radius:10px;background:var(--theme-raised,#f6f8fa)}
.tm-eligible ul,.tm-log,.tm-items,.tm-review ul{list-style:none;margin:0;padding:0}
.tm-eligible ul{display:flex;flex-wrap:wrap;gap:8px}
.tm-eligible li{display:flex;align-items:center;gap:6px;padding:5px 10px;border-radius:20px;background:var(--theme-panel,#fff);border:1px solid var(--line,#e4eaf1);font-size:13px}
.tm-eligible li small{font-size:11px}
.tm-dot{width:8px;height:8px;border-radius:50%;background:var(--muted,#9aa4b2);opacity:.6}.tm-dot.on{background:#2fbf71;opacity:1}
.tm-pending{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-radius:10px;background:var(--theme-warning-bg,#fbf3df);color:var(--theme-warning,#835916);font-weight:600}
.tm-change{padding:14px 16px;border-radius:10px;border:1px solid color-mix(in srgb,var(--accent,#34736a) 35%,transparent);background:color-mix(in srgb,var(--accent-soft,#eaf3f0) 70%,transparent);line-height:1.9}
.tm-actions{display:flex;gap:10px;flex-wrap:wrap}.tm-actions .primary-button{margin:0;min-width:140px}
.tm-readonly,.tm-muted{color:var(--muted,#6f7b8e)}.tm-error{color:var(--theme-error,#a93747)}
.tm-section{display:flex;flex-direction:column;gap:12px;padding:20px;border:1px solid var(--line,#e4eaf1);border-radius:12px;background:var(--theme-panel,#fff)}
.tm-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.tm-period{min-width:160px}
.tm-table table{width:100%}
.tm-log li,.tm-items li,.tm-review li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line,#e4eaf1)}
.tm-log li{flex-direction:column;align-items:flex-start;gap:2px}
.tm-log li:last-child,.tm-items li:last-child,.tm-review li:last-child{border-bottom:0}
.tm-items li>span,.tm-review li>span:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}
.tm-review{display:flex;flex-direction:column;gap:8px;padding:14px;border-radius:10px;background:var(--theme-raised,#f6f8fa)}
.tm-review-act{display:flex;gap:6px;flex-wrap:wrap;align-items:center}.tm-review-act .outline-button{margin:0}
.tm-neg{color:var(--theme-error,#a93747)}
.tm-dialog{width:min(640px,calc(100vw - 32px));max-height:calc(100vh - 40px);overflow:auto;padding:22px;border:1px solid var(--line,#e4eaf1);border-radius:14px;background:var(--theme-panel,#fff);color:var(--ink,#253047)}
.tm-dialog::backdrop{background:#0008}
.tm-dialog h3{font-size:15px;margin:18px 0 6px}
.tm-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.tm-dialog-head h2{font-size:17px}
.tm-dialog-row{display:flex;justify-content:flex-start;margin-bottom:12px}
.tm-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tm-stats div{display:flex;flex-direction:column;gap:4px;padding:12px;border-radius:10px;background:var(--theme-raised,#f6f8fa)}
.tm-stats span{font-size:12px;color:var(--muted,#6f7b8e)}.tm-stats b{font-size:18px}
.tm-move{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line,#e4eaf1)}
.tm-move label{display:flex;flex-direction:column;gap:6px;font-weight:600}.tm-move .primary-button{margin:0}.tm-move small{flex-basis:100%}
.tm-transfer-dd .text-button{padding:0;color:var(--accent,#34736a);font-weight:600}
#team-table [data-tm-profile]{margin-inline-start:8px}
/* Commission system: the employee keeps the customer; only the admin moves customers.
   The old "new messages go to" setting does not apply there, so it is hidden (kept for the fixed system). */
html.tm-commission .settings-card:has(#routing-form){display:none}
html.tm-commission:not(.tm-editor) #transfer-conversation{display:none!important}
html[data-theme="dark"] .tm-card.selected{background:color-mix(in srgb,var(--accent,#4fd1b1) 10%,var(--theme-panel,#111d26))}
html[data-theme="dark"] .tm-pending{background:#2d2716;color:#ebc180}
html[data-theme="dark"] .tm-tabs button.active{box-shadow:0 1px 4px #0006}
html[data-theme="dark"] .tm-dialog{border-color:#344954}
@media (max-width:720px){
  .tm-cards{grid-template-columns:1fr}
  .tm-tabs{width:100%}.tm-tabs button{flex:1;padding:9px 10px}
  .tm-settings,.tm-section,.tm-card{padding:14px}
  .tm-card{padding-top:36px}
  .tm-current{top:10px;left:12px}
  .tm-stats{grid-template-columns:1fr 1fr}
  .tm-review li{flex-direction:column;align-items:stretch}
  .tm-actions .primary-button{flex:1}
}
.customer-details dd.tm-transfer-dd .text-button{color:var(--accent,#34736a);font-weight:600;text-decoration:underline;text-underline-offset:3px}
/* Wallet (owner request, 6 Nov 2026) */
.tm-wallet{display:flex;flex-direction:column;gap:4px;padding:16px 18px;border-radius:12px;background:linear-gradient(135deg,color-mix(in srgb,var(--accent,#34736a) 92%,#000),var(--accent,#34736a));color:#fff;margin-bottom:12px}
.tm-wallet span{font-size:13px;opacity:.85}.tm-wallet b{font-size:28px;line-height:1.3}.tm-wallet small{color:#ffffffd0;font-size:12.5px}
html[data-theme="dark"] .tm-wallet{color:#06261f;background:linear-gradient(135deg,var(--accent,#4fd1b1),color-mix(in srgb,var(--accent,#4fd1b1) 70%,#fff))}
html[data-theme="dark"] .tm-wallet small{color:#06261fcc}
.tm-payout{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;padding:12px 14px;margin-bottom:12px;border:1px dashed var(--line,#e4eaf1);border-radius:10px}
.tm-payout label{display:flex;flex-direction:column;gap:6px;font-weight:600;flex:1 1 160px}.tm-payout .primary-button{margin:0}
.tm-stats-2{grid-template-columns:1fr 1fr}
.tm-customers{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.tm-customer{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--line,#e4eaf1);border-radius:10px;text-align:start}
.tm-customer[aria-expanded="true"]{border-color:var(--accent,#34736a)}
.tm-customer>span:first-child{display:flex;flex-direction:column;gap:2px}
.tm-sub{margin:4px 12px 6px!important;padding-inline-start:10px!important;border-inline-start:2px solid var(--line,#e4eaf1)}
.tm-pos{color:var(--theme-success,#216a4b)}
.tm-wallet-rail{position:relative}.tm-wallet-rail .tm-wallet-label{display:none}
/* Online log */
.tm-presence{display:block;margin-top:2px;font-size:11.5px;color:var(--muted,#6f7b8e)}
.tm-presence.on,.tm-live{color:var(--theme-success,#216a4b);font-weight:600}
.tm-presence.on::before{content:'';display:inline-block;width:7px;height:7px;margin-inline-end:5px;border-radius:50%;background:#2fbf71;vertical-align:middle}
/* Detailed permissions (owner request, 6 Nov 2026): accounts without cost visibility see sale figures only. */
html.tl-no-cost .tl-cost,html.tl-no-cost .shipping-analytics-stats .stat-margin{display:none!important}
