/* DUTIFY Broker Workspace Polish v1
   Visual-only layer: progressive disclosure, compact lists, responsive layouts.
   No business logic, mock content, or backend changes. */

:root{--workspace-radius:18px;--workspace-elev:0 8px 32px rgba(18,24,32,.045)}
html[data-theme=dark]{--workspace-elev:0 10px 32px rgba(0,0,0,.16)}
.broker-table-row[hidden]{display:none!important}

/* Shared page rhythm */
.broker-home-head,.section-head:has(+ .broker-client-metrics){margin-bottom:17px}
.broker-home-head h2{letter-spacing:-.035em}
.broker-home-panel,.broker-clients-table,.files-hub-table,.chat-hub-table,.team-table{
  box-shadow:var(--workspace-elev)!important
}
.broker-home-panel,.broker-client-metrics>div,.broker-files-detail,.broker-client-panel{
  border-color:var(--approved-line)
}
.broker-primary b{font-weight:750;line-height:1.35;overflow-wrap:anywhere}
.broker-primary small{font-size:12px;line-height:1.45}
.broker-table-head{text-transform:uppercase;letter-spacing:.055em;font-size:10.5px!important}
.broker-table-row{transition:background .18s ease,box-shadow .18s ease}
@media(hover:hover){
  .broker-table-row:hover{background:var(--approved-soft)}
  .broker-kpi:hover{border-color:var(--approved-accent);box-shadow:0 10px 26px rgba(24,30,35,.08)}
}
.broker-table-row:focus-within{box-shadow:inset 3px 0 0 var(--approved-accent)}
.broker-kpi:focus-visible,.broker-reveal summary:focus-visible,
.broker-files-reveal summary:focus-visible,.broker-client-cases-disclosure summary:focus-visible,
.team-profile-disclosure summary:focus-visible,.team-role-disclosure summary:focus-visible,
.team-invites-disclosure summary:focus-visible{outline:2px solid var(--approved-accent);outline-offset:3px}
.broker-toolbar .search-box{max-width:640px}
.broker-toolbar input{min-width:0}
.broker-table .btn{white-space:nowrap}

/* Dashboard: all three preview lists are permanently visible; secondary pages retain accordions. */
.broker-kpis{gap:12px}
.broker-kpi{box-shadow:var(--workspace-elev);position:relative;overflow:hidden}
.broker-kpi:before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:transparent;transition:background .18s}
.broker-kpi:hover:before,.broker-kpi:focus-visible:before{background:var(--approved-accent)}
.broker-home-grid{align-items:start}
.broker-home-panel{min-width:0;border-radius:18px!important}
.broker-home-panel .panel-title h3{font-size:17px;letter-spacing:-.02em}
.broker-home-panel .panel-title p{font-size:12px;line-height:1.5}
.broker-home-panel .text-action{padding:5px 0;white-space:nowrap;font-size:12px}

/* Always-visible home previews: no redundant labels or double dividers. */
.broker-home-preview{
  margin-top:12px;
  border-top:1px solid var(--approved-line);
  min-width:0;
  padding-top:11px;
}
.broker-home-preview>.broker-mini-list{
  border-top:0;
  padding-top:0;
}

.broker-reveal{margin-top:11px;border-top:1px solid var(--approved-line)}
.broker-reveal-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-height:42px;padding:10px 0;cursor:pointer;color:var(--approved-ink);
  font-weight:700;font-size:12px;list-style:none}
.broker-reveal-summary::-webkit-details-marker{display:none}
.broker-reveal-summary::marker{content:""}
.broker-reveal-chevron{display:inline-grid;place-items:center;font-size:18px;font-weight:700;
  width:27px;height:27px;border-radius:9px;border:1px solid var(--approved-line);
  background:var(--approved-soft);color:var(--approved-muted);
  transition:transform .2s ease;flex:none}
details[open]>.broker-reveal-summary .broker-reveal-chevron,
details[open]>summary .broker-reveal-chevron{transform:rotate(180deg)}
.broker-reveal .broker-mini-list{border-top:1px solid var(--approved-line);padding-top:5px}
.broker-mini-row,.broker-offer-mini{border-radius:10px}
.broker-attention-action{border-radius:13px}
.broker-attention-action b{font-variant-numeric:tabular-nums}
.broker-attention-action small{line-height:1.5}
.broker-attention-action:active{transform:translateY(0)}

/* Chats: key context is legible, full conversation remains one click away. */
.chat-hub-table .broker-table-head,
.chat-hub-table .broker-table-row{
  grid-template-columns:minmax(230px,1.45fr) minmax(130px,.85fr) minmax(120px,.8fr)
    minmax(110px,.75fr) 88px 112px;gap:12px
}
.chat-hub-table .broker-table-row>.broker-unread{justify-self:start}
.chat-hub-table .broker-primary>.approved-icon,
.chat-hub-table .broker-primary>span:first-child{
  width:38px;height:38px;display:grid;place-items:center;border-radius:12px;
  background:var(--approved-soft);border:1px solid var(--approved-line);flex:none
}
.chat-hub-table .broker-primary>span:first-child .approved-icon{width:19px;height:19px}
.chat-hub-table .broker-table-row>span:not(.broker-unread){font-size:13px;overflow-wrap:anywhere}
.chat-hub-table .broker-table-row>.btn{justify-self:stretch}
.chat-hub-table .broker-unread{font-size:12px}

/* Files: compact case list; document body expands after case selection. */
.files-hub-table .broker-table-head,.files-hub-table .broker-table-row{
  grid-template-columns:minmax(230px,1.35fr) minmax(155px,.8fr) 75px minmax(130px,.8fr) 142px
}
.files-hub-table .broker-table-row>strong{font-variant-numeric:tabular-nums}
.files-hub-table .files-selected{background:var(--approved-soft)}
.files-hub-table .broker-table-row>.btn{justify-self:stretch}
.broker-files-detail{padding:20px;border:1px solid var(--approved-line);border-radius:18px;
  background:var(--approved-card);box-shadow:var(--workspace-elev)}
.broker-files-detail-head{margin-bottom:15px}
.broker-files-detail-head h3{font-size:18px;letter-spacing:-.02em}
.broker-files-reveal{border-top:1px solid var(--approved-line);padding-top:4px}
.broker-files-reveal>summary{
  list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:11px 0;cursor:pointer;font-size:13px;font-weight:750;color:var(--approved-ink)
}
.broker-files-reveal>summary::-webkit-details-marker{display:none}
.broker-files-reveal>summary::marker{content:""}
.broker-files-reveal>.card,.broker-files-reveal>.checklist-card{margin-top:12px}
.broker-files-hint{background:var(--approved-soft);font-size:13px;line-height:1.55}

/* Clients: only essential data in the list; contact details and history in modal. */
.broker-client-layout{display:block!important}
.broker-clients-table .broker-table-head,
.broker-clients-table .broker-table-row{
  grid-template-columns:minmax(215px,1.5fr) minmax(130px,.7fr) 145px 130px;
  gap:12px;min-width:0
}
.broker-client-row{padding:13px 18px!important}
.broker-client-row>.broker-primary{min-width:0}
.broker-client-avatar{background:linear-gradient(145deg,var(--approved-soft),var(--approved-card));
  border:1px solid var(--approved-line);border-radius:13px}
.broker-client-selected{box-shadow:inset 3px 0 0 var(--approved-accent)}
.broker-client-activity{font-weight:650;font-size:13px;white-space:nowrap}
.broker-client-active-dot{display:inline-block;width:7px;height:7px;margin-right:7px;
  background:#28a66a;border-radius:50%;vertical-align:2px}
.broker-client-last{font-size:12px;color:var(--approved-muted)}
.broker-client-detail-action{justify-self:stretch;gap:12px}
.broker-client-detail-action span{font-size:16px}
.broker-client-modal .modal-head{margin-bottom:16px}
.modal-card:has(.broker-client-modal){width:min(760px,100%);padding:24px}
.broker-client-modal .broker-client-panel-head{padding:12px 0 16px;border-bottom:1px solid var(--approved-line)}
.broker-client-modal .broker-client-panel-head h3{font-size:18px}
.broker-client-modal .broker-client-panel-head p{font-size:12px}
.broker-client-modal .broker-client-contact{grid-template-columns:repeat(2,minmax(0,1fr));
  padding:15px;gap:12px;background:var(--approved-soft)}
.broker-client-modal .broker-client-contact b{font-size:13px}
.broker-client-cases-disclosure{margin-top:18px;border:1px solid var(--approved-line);
  border-radius:14px;overflow:hidden}
.broker-client-cases-disclosure>summary{list-style:none;display:flex;align-items:center;
  gap:12px;min-height:52px;padding:12px 16px;cursor:pointer;font-size:14px;font-weight:750}
.broker-client-cases-disclosure>summary::-webkit-details-marker{display:none}
.broker-client-cases-disclosure>summary::marker{content:""}
.broker-client-cases-disclosure>summary>b{margin-left:auto;font-size:12px;padding:4px 9px;
  background:var(--approved-soft);border-radius:999px;border:1px solid var(--approved-line)}
.broker-client-cases-disclosure>.broker-client-cases{border-top:1px solid var(--approved-line);
  padding:12px;display:grid;gap:10px;max-height:460px;overflow:auto}
.broker-client-case{background:var(--approved-card);border-radius:13px}
.broker-client-case .btn{min-height:38px}
.broker-client-modal .approved-modal-actions{margin-top:18px}

/* Team: roster first; individual permissions and invitation history on demand. */
.team-overview-counts{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0 8px}
.team-overview-counts>span{font-size:12px;font-weight:700;display:inline-flex;align-items:center;
  background:var(--approved-soft);border:1px solid var(--approved-line);
  padding:8px 12px;border-radius:999px;color:var(--approved-ink)}
.team-table .broker-table-row>div:last-child{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.team-table .broker-table-head,.team-table .broker-table-row{
  grid-template-columns:minmax(215px,1.5fr) 108px 114px 148px minmax(170px,.8fr);gap:12px
}
.team-role-disclosure{display:inline-block;position:relative}
.team-role-disclosure>summary{list-style:none;padding:9px 11px;border:1px solid var(--approved-line);
  border-radius:10px;background:var(--approved-soft);font-size:12px;font-weight:700;cursor:pointer}
.team-role-disclosure>summary::-webkit-details-marker{display:none}
.team-role-disclosure>summary::marker{content:""}
.team-role-disclosure[open]>summary{border-color:var(--approved-accent)}
.team-role-disclosure>.btn{display:block;margin-top:7px;max-width:100%;white-space:normal;font-size:12px}
.team-invites-disclosure{padding:16px 18px!important}
.team-invites-disclosure>summary{list-style:none;cursor:pointer;margin:0!important;align-items:center}
.team-invites-disclosure>summary::-webkit-details-marker{display:none}
.team-invites-disclosure>summary::marker{content:""}
.team-invites-disclosure>.doc-list{margin-top:16px;padding-top:12px;border-top:1px solid var(--approved-line)}
.team-profile-disclosure{margin:0;padding:0!important;border:0!important;border-bottom:1px solid var(--approved-line)!important}
.team-profile-disclosure>summary{list-style:none;display:flex;align-items:center;
  justify-content:space-between;gap:12px;padding:17px 4px;cursor:pointer}
.team-profile-disclosure>summary::-webkit-details-marker{display:none}
.team-profile-disclosure>summary::marker{content:""}
.team-profile-disclosure>summary span{font-size:14px;font-weight:800}
.team-profile-disclosure>summary small{color:var(--approved-muted);font-size:11px;text-align:right}
.team-profile-disclosure[open]>summary{color:var(--approved-ink)}
.team-profile-disclosure>.team-profile-fields,
.team-profile-disclosure>.team-profile-note,
.team-profile-disclosure>.team-profile-activity,
.team-profile-disclosure>.team-profile-bio{margin:0 0 17px}
.team-profile-section .team-profile-fields{margin-bottom:16px}
.team-profile-summary{padding:14px;border-radius:15px;background:var(--approved-soft);gap:15px}

/* Tablet / narrow laptop: no horizontal clipping, keep actions accessible. */
@media(max-width:1200px) and (min-width:701px){
  .broker-clients-table,.files-hub-table,.chat-hub-table,.team-table{overflow-x:auto}
  .broker-clients-table .broker-table-head,.broker-clients-table .broker-table-row{min-width:670px}
  .files-hub-table .broker-table-head,.files-hub-table .broker-table-row{min-width:750px}
  .chat-hub-table .broker-table-head,.chat-hub-table .broker-table-row{min-width:850px}
  .team-table .broker-table-head,.team-table .broker-table-row{min-width:815px}
}
@media(max-width:700px){
  .broker-home-grid{gap:11px}
  .broker-home-panel{padding:15px!important}
  .broker-kpi{gap:8px}
  .broker-attention{grid-template-columns:1fr 1fr;gap:8px}
  .broker-attention-action{padding:12px!important}
  .broker-attention-action b{font-size:20px}
  .broker-attention-action small{font-size:11px}
  .broker-client-metrics>div{border-radius:12px}
  .broker-clients-table,.files-hub-table,.chat-hub-table,.team-table{overflow:visible}
  .broker-client-row{grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important}
  .broker-client-row>.broker-primary{grid-column:1/-1!important}
  .broker-client-row>.broker-client-activity{grid-column:1/2!important}
  .broker-client-row>.broker-client-last{grid-column:2/3!important;text-align:right}
  .broker-client-row>.broker-client-detail-action{grid-column:1/-1!important;width:100%}
  .files-hub-table .broker-table-row{grid-template-columns:minmax(0,1fr) auto!important}
  .files-hub-table .broker-table-row>.broker-primary{grid-column:1/-1!important}
  .files-hub-table .broker-table-row>span{grid-column:1/2!important}
  .files-hub-table .broker-table-row>strong{grid-column:2/3!important}
  .files-hub-table .broker-table-row>.btn{grid-column:1/-1!important}
  .chat-hub-table .broker-table-row{grid-template-columns:minmax(0,1fr) auto!important}
  .chat-hub-table .broker-table-row>.broker-primary{grid-column:1/-1!important}
  .chat-hub-table .broker-table-row>span{grid-column:1/2!important}
  .chat-hub-table .broker-table-row>.broker-unread{grid-column:2/3!important}
  .chat-hub-table .broker-table-row>.btn{grid-column:1/-1!important}
  .team-table .broker-table-row{grid-template-columns:minmax(0,1fr) auto!important}
  .team-table .broker-table-row>.broker-primary{grid-column:1/-1!important}
  .team-table .broker-table-row>span{grid-column:1/2!important}
  .team-table .broker-table-row>div:last-child{grid-column:1/-1!important}
  .broker-files-detail{padding:14px}
  .broker-files-detail-head{flex-wrap:wrap}
  .broker-client-modal .broker-client-contact{grid-template-columns:1fr}
  .broker-client-modal .broker-client-case-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
  .modal-card:has(.broker-client-modal){padding:16px}
  .team-invites-disclosure{padding:13px!important}
  .team-profile-disclosure>summary small{max-width:44%}
  .team-role-disclosure>.btn{max-width:100%}
}
@media(max-width:410px){
  .broker-kpis{grid-template-columns:1fr 1fr;gap:7px}
  .broker-kpi{grid-template-columns:1fr 16px}
  .broker-kpi>span:first-child{display:none}
  .broker-attention{grid-template-columns:1fr}
  .broker-client-metrics b{font-size:18px}
  .broker-client-metrics small{font-size:10px}
}
@media(prefers-reduced-motion:reduce){
  .broker-kpi,.broker-table-row,.broker-reveal-chevron,.broker-attention-action{transition:none!important}
}

/* Broker profile: identity and KPIs first, optional detail groups second. */
.broker-profile-reveal{display:block;min-width:0;border:1px solid var(--approved-line);
  border-radius:16px;background:var(--approved-card);overflow:hidden;
  box-shadow:var(--workspace-elev)}
.broker-profile-reveal>summary{list-style:none;display:flex;align-items:center;
  justify-content:space-between;gap:12px;min-height:59px;padding:15px 17px;cursor:pointer}
.broker-profile-reveal>summary::-webkit-details-marker{display:none}
.broker-profile-reveal>summary::marker{content:""}
.broker-profile-reveal>summary>span:first-child{font-size:14px;font-weight:800}
.broker-profile-reveal>summary small{display:block;font-size:11px;font-weight:600;
  margin-top:3px;color:var(--approved-muted)}
.broker-profile-reveal[open]>summary{border-bottom:1px solid var(--approved-line)}
.broker-profile-reveal>.broker-profile-card,.broker-profile-reveal>.card{
  margin:12px;border-radius:13px!important;box-shadow:none!important}
.broker-profile-reveal>summary:focus-visible{outline:2px solid var(--approved-accent);outline-offset:-3px}
@media(max-width:700px){
  .broker-profile-reveal>summary{padding:13px 15px}
  .broker-profile-reveal>.broker-profile-card,.broker-profile-reveal>.card{margin:8px}
}

/* Dashboard disclosure controls: visible button styling, native <summary> behavior. */
.broker-reveal-summary{
  min-height:54px;
  padding:10px 0;
  font-size:13px;
  font-weight:750;
  gap:14px;
}
.broker-reveal-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:11px;
  min-height:36px;
  min-width:114px;
  padding:8px 13px;
  border:1px solid var(--approved-accent);
  border-radius:10px;
  background:var(--approved-accent);
  color:#15181d;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
  box-sizing:border-box;
  transition:filter .15s ease, transform .15s ease;
}
.broker-reveal-action::after{
  content:"";
  width:7px;
  height:7px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:translateY(-2px) rotate(45deg);
  transition:transform .15s ease;
}
.broker-reveal[open] .broker-reveal-action::after{
  transform:translateY(2px) rotate(225deg);
}
.broker-reveal .broker-reveal-hide,
.broker-reveal[open] .broker-reveal-show{display:none}
.broker-reveal[open] .broker-reveal-hide{display:inline}
@media(hover:hover){
  .broker-reveal-summary:hover .broker-reveal-action{filter:brightness(.96)}
}
.broker-reveal-summary:focus-visible{border-radius:10px}
@media(max-width:700px){
  .broker-reveal-action{min-width:103px;padding:8px 11px;min-height:36px}
}
@media(prefers-reduced-motion:reduce){
  .broker-reveal-action,.broker-reveal-action::after{transition:none}
}

/* Consistent DUTIFY accordion action in EVERY page and modal, not bare arrows.
   <summary> remains the real accessible interactive control. */
:where(#app,#modal) details>summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
:where(#app,#modal) details>summary::-webkit-details-marker{display:none}
:where(#app,#modal) details>summary::marker{content:""}
/* Suppress any legacy CSS-generated arrows; keep only the styled action. */
:where(#app,#modal) details>summary::after{content:none!important;display:none!important}
:where(#app,#modal) details>summary .broker-reveal-chevron{display:none!important}
:where(#app,#modal) details>summary>.broker-disclosure-button{
  margin-left:auto;
  flex:none;
  min-width:107px;
  border-radius:10px;
}
:where(#app,#modal) details:not([open])>summary .broker-reveal-hide{display:none!important}
:where(#app,#modal) details[open]>summary .broker-reveal-show{display:none!important}
:where(#app,#modal) details[open]>summary .broker-reveal-hide{display:inline!important}
:where(#app,#modal) details[open]>summary>.broker-disclosure-button::after{
  transform:translateY(2px) rotate(225deg);
}
:where(#app,#modal) details>summary:hover>.broker-disclosure-button{
  filter:brightness(.96);
}
:where(#app,#modal) details>summary:focus-visible{
  outline:2px solid var(--approved-accent);
  outline-offset:3px;
  border-radius:10px;
}
@media(max-width:700px){
  :where(#app,#modal) details>summary>.broker-disclosure-button{
    min-width:98px;
    padding:8px 10px;
  }
}
/* Broker offer detail modal: readable fields at all screen widths. */
.broker-proposal-modal .modal-head h2{font-size:21px;overflow-wrap:anywhere}
.broker-proposal-modal .modal-head p{font-size:12px;color:var(--approved-muted)}
.broker-proposal-price{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  flex-wrap:wrap;padding:17px 0;border-top:1px solid var(--approved-line);
  border-bottom:1px solid var(--approved-line)
}
.broker-proposal-price strong{font-size:27px;font-weight:800;font-variant-numeric:tabular-nums}
.broker-proposal-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin:18px 0;
}
.broker-proposal-field{
  border:1px solid var(--approved-line);border-radius:12px;
  background:var(--approved-soft);padding:12px 14px;min-width:0;
}
.broker-proposal-field small{
  display:block;color:var(--approved-muted);font-weight:650;font-size:11px;margin-bottom:6px;
}
.broker-proposal-field b{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.broker-proposal-grid>.broker-proposal-field:nth-child(n+3){grid-column:1/-1}
@media(max-width:700px){
  .broker-proposal-grid{grid-template-columns:1fr;gap:9px}
  .broker-proposal-grid>.broker-proposal-field:nth-child(n+3){grid-column:auto}
  .broker-proposal-modal .approved-modal-actions{flex-wrap:wrap}
  .broker-proposal-modal .approved-modal-actions>.btn{flex:1}
}
