/* /home/maximapr/public_html/biv1/assets/css/main.css */
/* /home/maximapr/public_html/biv1/assets/css/main.css */
:root{
  --bg:#0b0f14; --panel:#101824; --text:#e9eef6; --muted:#a8b3c7;
  --primary:#5aa7ff; --danger:#ff6b6b; --ok:#2dd4bf;
  --border:rgba(255,255,255,.10); --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:18px; --focus:0 0 0 3px rgba(90,167,255,.35);
  --font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,"Noto Sans","Helvetica Neue",sans-serif;
}
[data-theme="light"]{
  --bg:#f6f7fb; --panel:#fff; --text:#101824; --muted:#4b5563;
  --primary:#1d66ff; --danger:#e11d48; --ok:#0f766e;
  --border:rgba(16,24,36,.10); --shadow:0 10px 30px rgba(16,24,36,.10);
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);line-height:1.4}
button,input,select,textarea{font:inherit}
button{font-family:var(--font)}
img{max-width:100%;height:auto}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:1060px;margin:0 auto;padding:18px 14px 28px}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 0 18px;
  flex-wrap:wrap;
}
.header > *{min-width:0}

.brand{display:flex;align-items:center;gap:12px;min-width:0}
.brand img{height:48px;width:auto;max-width:min(420px,70vw);object-fit:contain}
.brand .subtitle{color:var(--muted);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
  min-width:0;
}

.grid{display:grid;gap:14px}
.grid.two{grid-template-columns:1fr}
@media (min-width:860px){
  .grid.two{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr)}
}

.h1{font-size:22px;margin:0 0 6px}
.h2{font-size:18px}
.p{margin:0;color:var(--muted);overflow-wrap:anywhere}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:12px 0;
  min-width:0;
}
.label{font-size:14px;color:var(--muted)}

.input{
  width:100%;
  max-width:100%;
  height:44px;
  border-radius:14px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  padding:0 12px;
  outline:none;
  min-width:0;
}
.input:focus{box-shadow:var(--focus);border-color:rgba(90,167,255,.55)}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.row > *{min-width:0}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:34px;
  height:auto;
  padding:6px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(90,167,255,.14);
  color:var(--text);
  cursor:pointer;
  user-select:none;
  max-width:100%;
  font-family:var(--font);
  font-size:12px;
  font-weight:500;
  line-height:1.15;
  letter-spacing:0;
  text-align:center;
  text-decoration:none;
  appearance:none;
  -webkit-appearance:none;
  white-space:normal;
}
.btn:hover{filter:brightness(1.05)}
.btn:focus{outline:none;box-shadow:var(--focus)}
.btn.primary{background:var(--primary);border-color:transparent;color:#0b0f14;font-weight:700}
[data-theme="light"] .btn.primary{color:#fff}
.btn.secondary{background:rgba(90,167,255,.10);border-color:rgba(90,167,255,.32);color:var(--text)}
[data-theme="light"] .btn.secondary{background:rgba(29,102,255,.08);border-color:rgba(29,102,255,.22);color:#1d4ed8}
.btn.ghost{background:transparent;font-weight:500}
.btn.danger{border-color:rgba(255,107,107,.45);background:rgba(255,107,107,.10);color:var(--text)}
.btn.btn-sm{min-height:30px;padding:5px 8px;border-radius:10px;font-size:11px;gap:6px}
.btn[disabled],.btn:disabled{opacity:.58;cursor:not-allowed;filter:none}

.alert{
  border-radius:14px;
  border:1px solid var(--border);
  padding:12px;
  color:var(--text);
  background:rgba(255,255,255,.04);
  overflow-wrap:anywhere;
}
.alert.danger{border-color:rgba(255,107,107,.5);background:rgba(255,107,107,.10)}
.alert.ok{border-color:rgba(45,212,191,.5);background:rgba(45,212,191,.10)}
.alert.info{border-color:rgba(90,167,255,.35);background:rgba(90,167,255,.08)}

.small{font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.hr{height:1px;background:var(--border);margin:14px 0}
.kbd{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:12px;border:1px solid var(--border);padding:2px 6px;border-radius:8px;background:rgba(255,255,255,.04)}

.input.invalid{
  border-color:rgba(255,107,107,.60);
  background:rgba(255,107,107,.06);
}

select.input{
  background:var(--panel);
  color:var(--text);
}
[data-theme="light"] select.input{
  background:#fff;
  color:var(--text);
}
select.input option{
  background:var(--panel);
  color:var(--text);
}
[data-theme="light"] select.input option{
  background:#fff;
  color:var(--text);
}

.card.muted{
  background:rgba(255,255,255,.03);
}
[data-theme="light"] .card.muted{
  background:rgba(16,24,36,.04);
}

.tip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;height:18px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  color:var(--muted);
  cursor:help;
  position:relative;
  user-select:none;
}
.tip::after{
  content:attr(data-tip);
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:calc(100% + 10px);
  width:min(340px,70vw);
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  box-shadow:var(--shadow);
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
  font-size:13px;
  line-height:1.35;
  z-index:50;
}
.tip:hover::after,
.tip:focus::after{
  opacity:1;
}

.card.subtle{
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
}
.msg-ok{ color: var(--ok); }
.msg-warn{ color: var(--danger); }

.mp-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.mp-modal.open{ display: block; }
.mp-modal__overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
}
.mp-modal__card{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%,-50%);
  width: min(760px, calc(100vw - 28px));
  max-height: min(80vh, 680px);
  overflow:auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

:root{
  --bar-track: rgba(255,255,255,.12);
  --bar-fill: rgba(255,255,255,.42);
}
[data-theme="light"]{
  --bar-track: rgba(16,24,36,.10);
  --bar-fill: rgba(16,24,36,.35);
}
.mp-bar-track{
  height:12px;
  border-radius:10px;
  overflow:hidden;
  background: var(--bar-track);
}
.mp-bar-fill{
  height:100%;
  background: var(--bar-fill);
}

.mp-trunc{
  display:inline-block;
  max-width:240px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  vertical-align:bottom;
}
@media (max-width: 720px){
  .mp-trunc{ max-width:160px; }
}

.mp-badge{
  display:inline-flex;
  align-items:center;
  height:24px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  background:rgba(255,255,255,.04);
  color:var(--text);
  max-width:100%;
}
.mp-badge.ok{
  border-color:rgba(45,212,191,.45);
  background:rgba(45,212,191,.10);
}
.mp-badge.warn{
  border-color:rgba(255,107,107,.45);
  background:rgba(255,107,107,.10);
}

.mp-rowlink{
  display:block;
  color:inherit;
  text-decoration:none;
}
.mp-rowlink:hover{
  text-decoration:none;
  filter:brightness(1.05);
}

/* ===== UsuÃƒÂ¡rios / administraÃƒÂ§ÃƒÂ£o ===== */
.page-tools{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.page-tools > *{min-width:0}

.filters-grid{
  display:grid;
  gap:12px;
}
.filters-grid > *{min-width:0}
@media (min-width: 860px){
  .filters-grid{
    grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr) auto;
    align-items:end;
  }
}

.form-grid{
  display:grid;
  gap:12px;
}
.form-grid > *{min-width:0}
@media (min-width: 860px){
  .form-grid{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
}

.table-wrap{
  overflow:auto;
  width:100%;
}
.table{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
}
.table th,
.table td{
  padding:12px 10px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
  text-align:left;
  overflow-wrap:anywhere;
}
.table th{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}
.table td{
  font-size:14px;
}

.check-grid{
  display:grid;
  gap:10px;
}
.check-grid > *{min-width:0}
@media (min-width: 860px){
  .check-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

.check-item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.03);
  min-width:0;
}
[data-theme="light"] .check-item{
  background:rgba(16,24,36,.03);
}
.check-item input[type="checkbox"]{
  margin-top:3px;
  flex:0 0 auto;
}
.check-item > span{
  min-width:0;
  overflow-wrap:anywhere;
}
.check-item[data-home-mirror="1"]{
  border-color:rgba(90,167,255,.45);
  background:rgba(90,167,255,.08);
}

.footer{
  margin-top:18px;
  padding-top:12px;
}

/* ===== MÃƒÂ³dulos: cliente / contrato / parceiro / financeiro ===== */
.mp-module-grid{
  display:grid;
  gap:10px;
  grid-template-columns:1fr;
}
@media (min-width: 860px){
  .mp-module-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}
.mp-module-card{
  display:block;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  text-decoration:none;
  min-width:0;
}
[data-theme="light"] .mp-module-card{
  background:rgba(16,24,36,.03);
}
.mp-module-card:hover{
  text-decoration:none;
  filter:brightness(1.03);
}
.mp-module-title{
  font-size:14px;
  font-weight:700;
  margin:0 0 6px;
}

/* Status compactos para contratos / financeiro */
.mp-status{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:24px;
  padding:2px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  line-height:1.2;
  white-space:nowrap;
  background:rgba(255,255,255,.04);
  color:var(--text);
}
.mp-status.is-active{
  border-color:rgba(45,212,191,.45);
  background:rgba(45,212,191,.10);
}
.mp-status.is-active-soft{
  border-color:rgba(16,185,129,.35);
  background:rgba(16,185,129,.08);
}
.mp-status.is-pending{
  border-color:rgba(250,204,21,.40);
  background:rgba(250,204,21,.10);
}
.mp-status.is-waiting{
  border-color:rgba(96,165,250,.40);
  background:rgba(96,165,250,.10);
}
.mp-status.is-office-pending{
  border-color:rgba(251,146,60,.40);
  background:rgba(251,146,60,.10);
}
.mp-status.is-finalized{
  border-color:rgba(148,163,184,.40);
  background:rgba(148,163,184,.12);
}
.mp-status.is-cancelled,
.mp-status.is-problem,
.mp-status.is-overdue{
  border-color:rgba(255,107,107,.45);
  background:rgba(255,107,107,.10);
}

.mp-status-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:currentColor;
  opacity:.85;
}

/* Tabelas compactas do mÃƒÂ³dulo novo */
.mp-table-compact{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
}
.mp-table-compact th,
.mp-table-compact td{
  padding:8px 8px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
  text-align:left;
  overflow-wrap:anywhere;
}
.mp-table-compact th{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.mp-table-compact td{
  font-size:13px;
}

/* Cards compactos/resumo */
.mp-mini-grid{
  display:grid;
  gap:10px;
  grid-template-columns:repeat(2, minmax(0, 1fr));
}
@media (min-width: 860px){
  .mp-mini-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}
.mp-mini-card{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  background:rgba(255,255,255,.03);
  min-width:0;
}
[data-theme="light"] .mp-mini-card{
  background:rgba(16,24,36,.03);
}
.mp-mini-card .v{
  font-size:18px;
  font-weight:700;
  margin-top:4px;
}
/* ===== Overlays informativos previdenciÃƒÂ¡rios ===== */
.mp-info-overlay{
  position:fixed;
  inset:0;
  display:none;
  z-index:10000;
}
.mp-info-overlay.is-open{display:block;}
.mp-info-overlay-lock{overflow:hidden;}
.mp-info-overlay__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.58);
}
.mp-info-overlay__panel{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(980px, calc(100vw - 28px));
  max-height:min(88vh, 860px);
  display:flex;
  flex-direction:column;
  background:var(--panel);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.mp-info-overlay__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.03);
}
[data-theme="light"] .mp-info-overlay__head{background:rgba(16,24,36,.03);}
.mp-info-overlay__title{
  font-size:15px;
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}
.mp-info-overlay__actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
  flex:0 0 auto;
}
.mp-info-overlay__body{
  padding:14px;
  overflow:auto;
  outline:none;
}
.mp-info-overlay__body > .card:first-child{margin-top:0;}
.mp-info-overlay__body .container{padding:0;max-width:none;}
@media (max-width:720px){
  .mp-info-overlay__panel{
    width:calc(100vw - 14px);
    max-height:calc(100vh - 14px);
  }
  .mp-info-overlay__head{
    align-items:flex-start;
    flex-direction:column;
  }
  .mp-info-overlay__actions{justify-content:flex-start;}
}

.mp-info-overlay.is-fullscreen .mp-info-overlay__panel{
  left:0;
  top:0;
  transform:none;
  width:100vw;
  height:100vh;
  max-height:100vh;
  border-radius:0;
  border-left:0;
  border-right:0;
}
.mp-info-overlay:fullscreen{
  background:var(--bg);
}
.mp-info-overlay:-webkit-full-screen{
  background:var(--bg);
}
.mp-info-overlay.is-fullscreen .mp-info-overlay__body{
  flex:1 1 auto;
  min-height:0;
}


/* ===== CNIS / perfil tÃ©cnico da extraÃ§Ã£o ===== */
.mp-cnis-profile,
.mp-cnis-profile-grid{
  display:grid;
  gap:10px;
  grid-template-columns:1fr;
  width:100%;
  min-width:0;
}
@media (min-width:720px){
  .mp-cnis-profile,
  .mp-cnis-profile-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}
@media (min-width:980px){
  .mp-cnis-profile,
  .mp-cnis-profile-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
  .mp-cnis-profile-item.is-wide{grid-column:span 2;}
}
.mp-cnis-profile-item{
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.03);
  overflow:hidden;
}
[data-theme="light"] .mp-cnis-profile-item{background:rgba(16,24,36,.03);}
.mp-cnis-profile-item span{
  display:block;
  margin-bottom:4px;
  color:var(--muted);
  font-size:12px;
  line-height:1.2;
}
.mp-cnis-profile-item strong{
  display:block;
  max-width:100%;
  color:var(--text);
  font-size:13px;
  line-height:1.28;
  font-weight:700;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* ===== Cliente operacional ===== */
.client-workspace{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.client-topbar,
.client-section-title,
.client-block-head,
.client-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.client-title{
  margin:0;
  font-size:20px;
  line-height:1.18;
}
.client-subtitle,
.client-block-kicker,
.client-section-title p,
.client-modal-head span{
  color:var(--muted);
  font-size:12px;
}
.client-section-title h2,
.client-block-title{
  margin:0;
  font-size:16px;
  line-height:1.2;
}
.client-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  flex-wrap:wrap;
}
.client-alert{
  margin:0;
}
.client-block{
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--panel);
  padding:12px;
  box-shadow:0 4px 14px rgba(0,0,0,.08);
}
[data-theme="light"] .client-block{
  box-shadow:0 4px 14px rgba(16,24,36,.06);
}
.client-block--client{
  border-left:4px solid rgba(90,167,255,.75);
}
.client-block--contract{
  border-left:4px solid rgba(45,212,191,.75);
}
.client-block--case{
  border-left:4px solid rgba(245,158,11,.75);
}
.client-section{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.client-relation-workspace{
  gap:8px;
}
.client-view-tabs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.client-view-tab{
  border:1px solid var(--border);
  border-radius:7px;
  background:rgba(255,255,255,.025);
  color:var(--text);
  min-height:30px;
  padding:5px 10px;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
}
[data-theme="light"] .client-view-tab{
  background:rgba(16,24,36,.025);
}
.client-view-tab.is-active{
  background:rgba(45,212,191,.14);
  border-color:rgba(45,212,191,.44);
}
.client-view-panel{
  display:none;
}
.client-view-panel.is-active{
  display:block;
}
.client-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.client-facts,
.client-mini-grid,
.client-detail-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
  margin-top:10px;
}
@media (min-width: 760px){
  .client-facts{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .client-mini-grid{ grid-template-columns:repeat(6, minmax(0, 1fr)); }
  .client-detail-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
.client-facts div,
.client-mini-grid div,
.client-detail-grid div{
  min-width:0;
  border:1px solid var(--border);
  border-radius:7px;
  padding:7px 8px;
  background:rgba(255,255,255,.03);
}
[data-theme="light"] .client-facts div,
[data-theme="light"] .client-mini-grid div,
[data-theme="light"] .client-detail-grid div{
  background:rgba(16,24,36,.025);
}
.client-facts span,
.client-mini-grid span,
.client-detail-grid span{
  display:block;
  color:var(--muted);
  font-size:11px;
  line-height:1.25;
}
.client-facts strong,
.client-mini-grid strong,
.client-detail-grid strong{
  display:block;
  margin-top:2px;
  font-size:13px;
  line-height:1.25;
  overflow-wrap:anywhere;
}
.client-case-list{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:10px;
}
.client-case-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:7px 8px;
  border:1px solid var(--border);
  border-radius:7px;
  background:rgba(255,255,255,.025);
}
.client-case-row strong,
.client-case-row span{
  display:block;
}
.client-case-row span,
.client-case-meta span{
  color:var(--muted);
  font-size:12px;
}
.client-case-meta{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  flex-wrap:wrap;
}
.client-empty{
  border:1px dashed var(--border);
  border-radius:8px;
  padding:10px;
  color:var(--muted);
  font-size:13px;
}
.client-empty--compact{
  padding:7px 8px;
}
.client-modal-card{
  width:min(980px, calc(100vw - 24px));
  max-height:min(88vh, 780px);
  border-radius:8px;
}
.client-modal-head{
  margin-bottom:10px;
  padding-bottom:10px;
  border-bottom:1px solid var(--border);
}
.client-modal-head strong,
.client-modal-head span{
  display:block;
}
.client-tabs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.client-tab{
  border:1px solid var(--border);
  border-radius:999px;
  background:transparent;
  color:var(--text);
  min-height:28px;
  padding:4px 10px;
  cursor:pointer;
  font-size:12px;
}
.client-tab.is-active{
  background:rgba(90,167,255,.16);
  border-color:rgba(90,167,255,.42);
}
.client-tab-panel{
  display:none;
}
.client-tab-panel.is-active{
  display:block;
}
.client-modal-section-title{
  margin:12px 0 8px;
  font-size:14px;
}
.client-table{
  min-width:680px;
}
.client-table th,
.client-table td{
  padding:8px;
  font-size:13px;
}
.client-table-wrap{
  margin-bottom:10px;
}
.client-doc-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:8px;
}
.client-doc{
  border:1px solid var(--border);
  border-radius:8px;
  padding:9px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.client-doc span,
.client-notes{
  color:var(--muted);
  font-size:13px;
}
.client-notes{
  margin-top:10px;
  white-space:pre-wrap;
}
@media (max-width: 620px){
  .client-facts,
  .client-mini-grid,
  .client-detail-grid{
    grid-template-columns:1fr;
  }
  .client-case-row{
    align-items:flex-start;
    flex-direction:column;
  }
  .client-actions{
    justify-content:flex-start;
  }
}

/* ===== Atendimento WhatsApp / Iris ===== */
.mp-chat-topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  margin-bottom:12px;
  flex-wrap:wrap;
}
.mp-chat-search{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:min(100%, 520px);
}
.mp-chat-search .input{height:38px;border-radius:10px;}
.mp-chat-workspace{
  display:grid;
  grid-template-columns:minmax(250px, 330px) minmax(0, 1fr) minmax(240px, 300px);
  height:calc(100vh - 180px);
  min-height:560px;
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  background:var(--panel);
  box-shadow:var(--shadow);
}
.mp-chat-list{
  min-width:0;
  min-height:0;
  border-right:1px solid var(--border);
  background:rgba(255,255,255,.025);
}
.mp-chat-list-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  height:52px;
  padding:0 14px;
  border-bottom:1px solid var(--border);
}
.mp-chat-list-head span,
.mp-chat-panel-title span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  height:24px;
  padding:0 7px;
  border-radius:999px;
  background:rgba(90,167,255,.14);
  color:var(--text);
  font-size:12px;
}
.mp-chat-list-scroll{
  height:calc(100% - 52px);
  overflow:auto;
}
.mp-chat-item{
  display:grid;
  gap:4px;
  padding:12px 14px;
  color:var(--text);
  text-decoration:none;
  border-bottom:1px solid var(--border);
  min-width:0;
}
.mp-chat-item:last-child{border-bottom:0;}
.mp-chat-item:hover{
  text-decoration:none;
  background:rgba(90,167,255,.07);
}
.mp-chat-item-title,
.mp-chat-item-phone,
.mp-chat-item-preview,
.mp-chat-item-foot{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.mp-chat-item-title{font-weight:700;font-size:14px;}
.mp-chat-item-phone{color:var(--primary);font-size:12px;}
.mp-chat-item-preview{color:var(--muted);font-size:13px;}
.mp-chat-item-foot{
  display:flex;
  justify-content:space-between;
  gap:8px;
  color:var(--muted);
  font-size:12px;
}
.mp-chat-item.active{
  background:rgba(90,167,255,.12);
  box-shadow:inset 3px 0 0 var(--primary);
}
.mp-chat-main{
  display:grid;
  grid-template-rows:auto auto minmax(0, 1fr) auto;
  min-width:0;
  min-height:0;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(255,255,255,.018), transparent 170px);
}
.mp-chat-thread-head{
  grid-row:1;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  min-height:68px;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.mp-chat-contact-head{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.mp-chat-avatar{
  flex:0 0 auto;
  width:40px;
  height:40px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(90,167,255,.16);
  border:1px solid rgba(90,167,255,.28);
  color:var(--text);
  font-size:13px;
  font-weight:800;
  overflow:hidden;
}
.mp-chat-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.mp-chat-badges{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.mp-chat-inline-form{
  margin:0;
}
.mp-chat-thread{
  grid-row:3;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:0;
  overflow:auto;
  padding:18px 48px;
}
.mp-chat-lock{
  grid-row:2;
  margin:10px 16px 0;
  padding:9px 11px;
}
.mp-chat-empty{
  align-self:center;
  justify-self:center;
  padding:24px;
  text-align:center;
}
.mp-chat-message{
  position:relative;
  width:min(68%, 720px);
  padding:10px 12px 11px;
  border:1px solid var(--border);
  border-radius:12px;
  line-height:1.45;
  overflow-wrap:anywhere;
  box-shadow:0 8px 18px rgba(0,0,0,.10);
}
.mp-chat-message.customer{
  align-self:flex-start;
  background:color-mix(in srgb, var(--mp-chat-customer, #ffe08a) 24%, transparent);
  border-color:color-mix(in srgb, var(--mp-chat-customer, #ffe08a) 48%, transparent);
}
.mp-chat-message.own{
  align-self:flex-end;
  border-color:color-mix(in srgb, var(--mp-chat-own, #5aa7ff) 56%, transparent);
  background:color-mix(in srgb, var(--mp-chat-own, #5aa7ff) 22%, transparent);
}
.mp-chat-message.iris,
.mp-chat-message.team,
.mp-chat-message.bi{
  align-self:center;
  width:min(70%, 720px);
}
.mp-chat-message.iris{
  border-color:color-mix(in srgb, var(--mp-chat-iris, #f7b4d8) 52%, transparent);
  background:color-mix(in srgb, var(--mp-chat-iris, #f7b4d8) 24%, transparent);
}
.mp-chat-message.team{
  border-color:color-mix(in srgb, var(--mp-chat-team, #d8dee9) 42%, transparent);
  background:color-mix(in srgb, var(--mp-chat-team, #d8dee9) 18%, transparent);
}
.mp-chat-message.bi{
  border-color:color-mix(in srgb, var(--mp-chat-bi, #f4b183) 52%, transparent);
  background:color-mix(in srgb, var(--mp-chat-bi, #f4b183) 22%, transparent);
}
.mp-chat-message.internal{
  align-self:center;
  width:100%;
  border-color:color-mix(in srgb, var(--mp-chat-internal, #f4b183) 52%, transparent);
  background:color-mix(in srgb, var(--mp-chat-internal, #f4b183) 22%, transparent);
}
.mp-chat-message.is-highlighted{
  outline:2px solid rgba(250,204,21,.72);
  box-shadow:0 0 0 5px rgba(250,204,21,.12), 0 8px 18px rgba(0,0,0,.10);
}
.mp-chat-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px 8px;
  align-items:center;
  margin-bottom:4px;
  color:var(--muted);
  font-size:12px;
}
.mp-chat-meta strong{color:var(--text);}
.mp-chat-body{white-space:normal;}
.mp-chat-attachment{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
  padding:9px;
  border:1px solid var(--border);
  border-radius:10px;
  background:rgba(255,255,255,.035);
  color:var(--text);
  text-decoration:none;
  width:min(100%, 420px);
  text-align:left;
  cursor:pointer;
  appearance:none;
}
.mp-chat-attachment:hover{
  text-decoration:none;
  filter:brightness(1.05);
}
.mp-chat-attachment.has-thumb{
  display:grid;
  grid-template-columns:120px minmax(0, 1fr);
  align-items:center;
  padding:0;
  overflow:hidden;
}
.mp-chat-attachment.has-thumb img{
  width:120px;
  height:92px;
  object-fit:cover;
  display:block;
}
.mp-chat-attachment-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:8px;
  background:rgba(90,167,255,.16);
  font-weight:800;
}
.mp-chat-attachment strong,
.mp-chat-attachment small{
  display:block;
}
.mp-chat-attachment-info{
  min-width:0;
  padding:9px;
}
.mp-chat-attachment small{color:var(--muted);}
.mp-chat-message-actions{
  display:flex;
  gap:5px;
  opacity:0;
  transition:opacity .12s ease;
  position:absolute;
  top:6px;
  z-index:2;
}
.mp-chat-message:hover .mp-chat-message-actions,
.mp-chat-message:focus-within .mp-chat-message-actions{
  opacity:1;
}
.mp-chat-action{
  width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.08);
  color:var(--muted);
  cursor:pointer;
  padding:0;
  font-size:13px;
  line-height:1;
}
.mp-chat-action:hover,
.mp-chat-action:focus{
  color:var(--text);
  background:rgba(90,167,255,.14);
  outline:none;
}
.mp-chat-action:disabled{
  cursor:not-allowed;
  opacity:.42;
}
.mp-chat-message.customer .mp-chat-message-actions{
  left:calc(100% + 8px);
  flex-direction:column;
}
.mp-chat-message.own .mp-chat-message-actions{
  right:calc(100% + 8px);
  flex-direction:column;
}
.mp-chat-message.iris .mp-chat-message-actions,
.mp-chat-message.team .mp-chat-message-actions,
.mp-chat-message.bi .mp-chat-message-actions,
.mp-chat-message.internal .mp-chat-message-actions{
  top:calc(100% + 4px);
  left:50%;
  transform:translateX(-50%);
  flex-direction:row;
}
.mp-chat-compose{
  grid-row:4;
  display:grid;
  grid-template-columns:minmax(0, 1fr) 92px;
  gap:8px 10px;
  align-items:start;
  padding:12px 16px 14px;
  border-top:1px solid var(--border);
  background:color-mix(in srgb, var(--panel) 94%, transparent);
  position:relative;
  z-index:5;
  box-shadow:0 -10px 22px rgba(0,0,0,.12);
}
.mp-chat-compose-field{
  display:grid;
  gap:6px;
  min-width:0;
}
.mp-chat-compose textarea.input{
  min-height:76px;
  height:auto;
  resize:vertical;
  border-radius:12px;
  padding:10px 12px;
}
.mp-chat-compose-buttons{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:26px;
}
.mp-chat-compose-buttons .btn{
  width:100%;
  min-height:36px;
}
.mp-chat-context{
  min-width:0;
  min-height:0;
  border-left:1px solid var(--border);
  background:rgba(255,255,255,.018);
  overflow:auto;
}
.mp-chat-panel{
  padding:14px;
  border-bottom:1px solid var(--border);
}
.mp-chat-panel .h2{margin:0 0 10px;}
.mp-chat-panel-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
.mp-chat-facts{
  display:grid;
  grid-template-columns:82px minmax(0, 1fr);
  gap:8px 10px;
  margin:0;
  font-size:13px;
}
.mp-chat-facts dt{color:var(--muted);}
.mp-chat-facts dd{
  margin:0;
  min-width:0;
  overflow-wrap:anywhere;
}
.mp-chat-files{
  display:grid;
  gap:8px;
}
.mp-chat-file{
  display:grid;
  grid-template-columns:46px minmax(0, 1fr);
  gap:8px;
  padding:9px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:rgba(255,255,255,.025);
  color:var(--text);
  text-align:left;
  cursor:pointer;
  width:100%;
  appearance:none;
}
.mp-chat-file:hover{
  background:rgba(90,167,255,.08);
}
.mp-chat-file-mini{
  width:46px;
  height:46px;
  border-radius:8px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(90,167,255,.12);
  border:1px solid var(--border);
  font-weight:800;
}
.mp-chat-file-mini img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.mp-chat-file-text{
  min-width:0;
}
.mp-chat-file strong{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}
.mp-chat-file small{
  color:var(--muted);
  overflow-wrap:anywhere;
}
.mp-chat-file-thumb{
  grid-row:1 / span 4;
  width:64px;
  height:64px;
  border:1px solid var(--border);
  border-radius:10px;
  background:rgba(90,167,255,.12);
  color:var(--text);
  overflow:hidden;
  padding:0;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
}
.mp-chat-file-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.mp-chat-file-actions{
  display:flex;
  gap:6px;
  margin-top:6px;
  flex-wrap:wrap;
  grid-column:2;
}
.mp-chat-modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:10000;
}
.mp-chat-modal.open{
  display:block;
}
.mp-chat-modal-overlay{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.62);
}
.mp-chat-modal-card{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  width:min(860px, calc(100vw - 28px));
  max-height:min(88vh, 860px);
  display:flex;
  flex-direction:column;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.mp-chat-modal-card.wide{
  width:min(1040px, calc(100vw - 28px));
}
.mp-chat-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.03);
}
.mp-chat-modal-head .h2{
  margin:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.mp-chat-modal-body{
  min-height:220px;
  padding:14px;
  overflow:auto;
  display:flex;
  align-items:center;
  justify-content:center;
}
.mp-chat-modal-body img,
.mp-chat-modal-body video{
  max-width:100%;
  max-height:72vh;
  object-fit:contain;
}
.mp-chat-modal-body audio{
  width:min(100%, 640px);
}
.mp-chat-modal-body iframe{
  width:100%;
  min-height:70vh;
  border:0;
  background:#fff;
  border-radius:10px;
}
.mp-chat-gallery{
  padding:14px;
  overflow:auto;
  display:grid;
  gap:10px;
  grid-template-columns:repeat(auto-fill, minmax(132px, 1fr));
}
.mp-chat-gallery-item{
  min-height:124px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:8px;
  display:grid;
  gap:6px;
  align-content:start;
  cursor:pointer;
  text-align:left;
}
.mp-chat-gallery-item img{
  width:100%;
  aspect-ratio:4 / 3;
  object-fit:cover;
  border-radius:8px;
}
.mp-chat-gallery-item > span{
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background:rgba(90,167,255,.12);
  font-weight:700;
}
.mp-chat-gallery-item small{
  color:var(--muted);
}
body.mp-chat-modal-lock{
  overflow:hidden;
}
@media (max-width:900px){
  .mp-chat-topbar,
  .mp-chat-search{
    align-items:stretch;
    flex-direction:column;
  }
  .mp-chat-workspace{
    display:flex;
    flex-direction:column;
    height:auto;
    min-height:0;
    overflow:visible;
  }
  .mp-chat-list,
  .mp-chat-context{
    border:0;
    border-bottom:1px solid var(--border);
  }
  .mp-chat-list-scroll{
    max-height:28vh;
    height:auto;
  }
  .mp-chat-main{
    height:calc(100vh - 118px);
    min-height:620px;
    border-bottom:1px solid var(--border);
  }
  .mp-chat-message{
    width:min(92%, 720px);
  }
  .mp-chat-message.iris,
  .mp-chat-message.team,
  .mp-chat-message.bi{
    width:min(92%, 720px);
  }
  .mp-chat-thread{
    padding:18px 40px;
  }
  .mp-chat-compose{
    grid-template-columns:minmax(0, 1fr) 82px;
  }
  .mp-chat-context{
    max-height:none;
  }
  .mp-chat-attachment.has-thumb{
    grid-template-columns:96px minmax(0, 1fr);
  }
  .mp-chat-attachment.has-thumb img{
    width:96px;
    height:80px;
  }
  .mp-chat-modal-head{
    align-items:flex-start;
    flex-direction:column;
  }
}
