/* =====================================================
   Morpheus PD V24B - Finance + Staff Recovery Polish
   Safe additive CSS. Scoped to partner/staff only except small drawer polish.
===================================================== */

/* -----------------------------------------------------
   Partner Finance Dashboard / Table View
----------------------------------------------------- */
body[data-portal="client"] .partner-finance-hero{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-start;
  padding:24px;
  border-radius:32px;
  border:1px solid rgba(12,115,255,.16);
  background:radial-gradient(circle at top left,rgba(18,191,208,.16),transparent 36%),linear-gradient(135deg,#fff,#eef7ff);
  box-shadow:0 20px 60px rgba(6,27,58,.08);
  margin-bottom:16px;
}
body[data-portal="client"] .partner-finance-hero h2{
  margin:7px 0 10px;
  font-size:clamp(34px,4.5vw,58px);
  line-height:.98;
  letter-spacing:-.04em;
}
body[data-portal="client"] .partner-finance-dashboard{
  display:grid;
  grid-template-columns:1.4fr repeat(3,minmax(0,1fr));
  gap:14px;
  margin:14px 0 18px;
}
body[data-portal="client"] .partner-finance-metric{
  background:#fff;
  border:1px solid var(--line);
  border-radius:24px;
  padding:18px;
  box-shadow:0 12px 34px rgba(6,27,58,.06);
}
body[data-portal="client"] .partner-finance-metric.primary{
  background:radial-gradient(circle at top right,rgba(8,120,59,.12),transparent 38%),#fff;
  border-left:7px solid var(--green);
}
body[data-portal="client"] .partner-finance-metric span{
  display:block;
  color:var(--muted);
  font-weight:900;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
body[data-portal="client"] .partner-finance-metric b{
  display:block;
  margin:8px 0 5px;
  font-size:clamp(24px,2.7vw,36px);
  line-height:1;
  color:var(--navy);
}
body[data-portal="client"] .partner-finance-metric small{color:var(--muted);font-weight:800}
body[data-portal="client"] .partner-finance-control{
  display:grid;
  grid-template-columns:minmax(220px,.35fr) 1fr;
  align-items:center;
  gap:16px;
  margin-bottom:16px;
}
body[data-portal="client"] .partner-finance-control h3{margin:2px 0 0;color:var(--navy)}
body[data-portal="client"] #partnerFinanceSearch{
  width:100%;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px 15px;
  background:#fbfdff;
  outline:none;
}
body[data-portal="client"] #partnerFinanceSearch:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(12,115,255,.1);
}
body[data-portal="client"] .partner-finance-stack{display:grid;gap:14px}
body[data-portal="client"] .partner-finance-project-table{
  background:#fff;
  border:1px solid var(--line);
  border-left:7px solid var(--project-color,#147cff);
  border-radius:24px;
  overflow:hidden;
  box-shadow:0 12px 34px rgba(6,27,58,.06);
}
body[data-portal="client"] .partner-finance-project-table summary{
  list-style:none;
  display:grid;
  grid-template-columns:minmax(180px,1fr) auto auto;
  gap:14px;
  align-items:center;
  padding:16px 18px;
  cursor:pointer;
  background:linear-gradient(135deg,#fff,#f5f9ff);
}
body[data-portal="client"] .partner-finance-project-table summary::-webkit-details-marker{display:none}
body[data-portal="client"] .partner-finance-project-table summary span b,
body[data-portal="client"] .partner-finance-project-table summary span small{display:block}
body[data-portal="client"] .partner-finance-project-table summary span b{font-size:20px;color:var(--navy)}
body[data-portal="client"] .partner-finance-project-table summary span small{font-size:12px;color:var(--muted);margin-top:3px}
body[data-portal="client"] .partner-finance-project-table summary strong{
  color:var(--navy);
  font-size:18px;
  white-space:nowrap;
}
body[data-portal="client"] .partner-finance-project-table summary em{
  font-style:normal;
  color:var(--muted);
  font-weight:900;
  font-size:12px;
  background:#eef5ff;
  padding:8px 10px;
  border-radius:999px;
}
body[data-portal="client"] .partner-finance-table-wrap{overflow:auto;padding:0 14px 14px}
body[data-portal="client"] .partner-finance-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 8px;
  min-width:980px;
}
body[data-portal="client"] .partner-finance-table th{
  text-align:left;
  color:#48617d;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  padding:10px 12px;
}
body[data-portal="client"] .partner-finance-table td{
  background:#f8fbff;
  border-top:1px solid #dbe7f5;
  border-bottom:1px solid #dbe7f5;
  padding:12px;
  vertical-align:top;
  color:var(--ink);
}
body[data-portal="client"] .partner-finance-table td:first-child{border-left:1px solid #dbe7f5;border-radius:16px 0 0 16px}
body[data-portal="client"] .partner-finance-table td:last-child{border-right:1px solid #dbe7f5;border-radius:0 16px 16px 0}
body[data-portal="client"] .partner-finance-table td small{display:block;color:var(--muted);font-size:11px;margin-top:4px}
body[data-portal="client"] .finance-project-mark{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  background:var(--project-color,#147cff);
  margin-right:7px;
}
body[data-portal="client"] .finance-type-pill{
  display:inline-flex;
  padding:7px 9px;
  border-radius:999px;
  background:#eef5ff;
  color:#0b4a8d;
  font-weight:900;
  font-size:12px;
}
body[data-portal="client"] .finance-money-cell b{white-space:nowrap;color:var(--green)}
body[data-portal="client"] .finance-note-cell{max-width:360px;line-height:1.45;color:#334155}
body[data-portal="client"] .partner-finance-filechips{display:flex;flex-wrap:wrap;gap:6px;max-width:280px}
body[data-portal="client"] .partner-finance-filechips .file-chip.mini{font-size:11px;padding:7px 9px;border-radius:12px}
body[data-portal="client"] .finance-table-muted{color:var(--muted);font-size:12px}

/* -----------------------------------------------------
   Staff/Manager portal recovery polish
----------------------------------------------------- */
body[data-portal="staff"] .main{
  background:radial-gradient(circle at top left,rgba(12,115,255,.04),transparent 35%),var(--bg);
}
body[data-portal="staff"] .staff-app-hero,
body[data-portal="staff"] .manager-hero{
  display:flex!important;
  justify-content:space-between!important;
  gap:18px!important;
  align-items:flex-start!important;
  padding:24px!important;
  border-radius:32px!important;
  border:1px solid rgba(12,115,255,.16)!important;
  background:radial-gradient(circle at top left,rgba(18,191,208,.16),transparent 38%),linear-gradient(135deg,#fff,#eef7ff)!important;
  box-shadow:0 20px 60px rgba(6,27,58,.08)!important;
  margin-bottom:16px!important;
}
body[data-portal="staff"] .staff-app-hero.is-manager,
body[data-portal="staff"] .manager-hero.is-manager{
  background:radial-gradient(circle at top left,rgba(245,158,11,.15),transparent 38%),linear-gradient(135deg,#fff,#fff8ed)!important;
  border-color:rgba(245,158,11,.18)!important;
}
body[data-portal="staff"] .staff-app-hero h2,
body[data-portal="staff"] .manager-hero h2{
  margin:7px 0 10px!important;
  font-size:clamp(34px,4.5vw,58px)!important;
  line-height:1!important;
  letter-spacing:-.04em!important;
}
body[data-portal="staff"] .staff-bell{
  border:1px solid #d9e7f8!important;
  background:#fff!important;
  color:var(--navy)!important;
  border-radius:20px!important;
  padding:13px 16px!important;
  box-shadow:0 12px 34px rgba(6,27,58,.08)!important;
  cursor:pointer!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
body[data-portal="staff"] .staff-action-strip{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:12px!important;
  margin:14px 0 18px!important;
}
body[data-portal="staff"] .staff-action-btn{
  border:1px solid var(--line)!important;
  background:#fff!important;
  color:var(--navy)!important;
  border-radius:22px!important;
  padding:16px!important;
  text-align:left!important;
  box-shadow:0 10px 28px rgba(6,27,58,.05)!important;
  cursor:pointer!important;
}
body[data-portal="staff"] .staff-action-btn b{display:block;font-size:17px;margin-bottom:4px}
body[data-portal="staff"] .staff-action-btn small{color:var(--muted);font-weight:800;line-height:1.35}
body[data-portal="staff"] .staff-mini-balloons{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:12px!important;
  margin:14px 0 20px!important;
}
body[data-portal="staff"] .staff-mini-balloons>div{
  background:#fff!important;
  border:1px solid var(--line)!important;
  border-radius:22px!important;
  padding:16px!important;
  box-shadow:0 10px 28px rgba(6,27,58,.05)!important;
}
body[data-portal="staff"] .staff-mini-balloons b{display:block;font-size:32px;line-height:1;color:var(--navy)}
body[data-portal="staff"] .staff-mini-balloons span{display:block;color:var(--muted);font-size:12px;font-weight:900;margin-top:5px}
body[data-portal="staff"] .project-card,
body[data-portal="staff"] .update-card,
body[data-portal="staff"] .shipment-card,
body[data-portal="staff"] .finance-card{
  border:1px solid var(--line)!important;
  border-left:7px solid var(--project-color,#147cff)!important;
  border-radius:24px!important;
  background:#fff!important;
  box-shadow:0 12px 34px rgba(6,27,58,.06)!important;
  padding:18px!important;
}
body[data-portal="staff"] .manager-compact-grid,
body[data-portal="staff"] .manager-compact-list,
body[data-portal="staff"] .timeline{
  gap:12px!important;
}
body[data-portal="staff"] .compact-entry-card{
  padding:15px!important;
}
body[data-portal="staff"] .compact-entry-card .muted{display:none}
body[data-portal="staff"] .approval-accordion,
body[data-portal="staff"] .rejected-accordion{
  border:1px solid var(--line)!important;
  background:#fff!important;
  border-radius:24px!important;
  overflow:hidden!important;
  margin:16px 0!important;
  box-shadow:0 10px 28px rgba(6,27,58,.05)!important;
}
body[data-portal="staff"] .approval-accordion summary,
body[data-portal="staff"] .rejected-accordion summary{
  cursor:pointer!important;
  list-style:none!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:16px 18px!important;
  background:linear-gradient(135deg,#fff,#f3f8ff)!important;
  color:var(--navy)!important;
  font-weight:900!important;
}
body[data-portal="staff"] .approval-accordion summary::-webkit-details-marker,
body[data-portal="staff"] .rejected-accordion summary::-webkit-details-marker{display:none}
body[data-portal="staff"] .approval-accordion summary b,
body[data-portal="staff"] .rejected-accordion summary b{
  min-width:30px;height:30px;border-radius:999px;display:inline-grid;place-items:center;background:var(--blue);color:#fff;font-size:13px;
}
body[data-portal="staff"] .approval-list,
body[data-portal="staff"] .rejected-list{padding:14px!important}

/* Staff project workspace */
body[data-portal="staff"] .project-workspace.staff-workspace{
  border:1px solid color-mix(in srgb,var(--project-color,#147cff),white 70%)!important;
  border-radius:32px!important;
  padding:22px!important;
  background:linear-gradient(135deg,color-mix(in srgb,var(--project-color,#147cff),white 94%),#fff)!important;
  box-shadow:0 18px 50px rgba(6,27,58,.09)!important;
}
body[data-portal="staff"] .workspace-header{
  display:grid!important;
  grid-template-columns:auto 1fr auto!important;
  align-items:start!important;
  gap:16px!important;
  border-bottom:1px solid rgba(6,27,58,.08)!important;
  padding-bottom:16px!important;
  margin-bottom:14px!important;
}
body[data-portal="staff"] .workspace-header h2{font-size:clamp(30px,4vw,54px)!important;margin:4px 0 8px!important;letter-spacing:-.04em!important}
body[data-portal="staff"] .project-tabbar{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  margin:14px 0 18px!important;
}
body[data-portal="staff"] .project-tabbar button{
  border:1px solid #d9e7f8!important;
  background:#fff!important;
  color:#35506f!important;
  border-radius:999px!important;
  padding:10px 14px!important;
  font-weight:900!important;
  cursor:pointer!important;
}
body[data-portal="staff"] .project-tabbar button.active{
  background:var(--project-color,#147cff)!important;
  border-color:var(--project-color,#147cff)!important;
  color:#fff!important;
}

/* Staff forms and drawer */
body[data-portal="staff"] .drawer.open{
  display:grid!important;
  place-items:center!important;
  padding:18px!important;
  align-items:center!important;
  justify-content:center!important;
}
body[data-portal="staff"] .drawer-panel{
  width:min(940px,94vw)!important;
  max-height:91vh!important;
  height:auto!important;
  border-radius:34px!important;
  padding:26px!important;
  background:radial-gradient(circle at top left,rgba(12,115,255,.08),transparent 38%),#f8fbff!important;
  box-shadow:0 34px 100px rgba(6,27,58,.34)!important;
  border:1px solid rgba(217,231,248,.95)!important;
}
body[data-portal="staff"] .drawer-x{
  position:sticky!important;
  top:0!important;
  float:right!important;
  width:48px!important;
  height:48px!important;
  border-radius:999px!important;
  border:0!important;
  background:#eef5ff!important;
  color:var(--navy)!important;
  font-size:24px!important;
  font-weight:900!important;
  cursor:pointer!important;
  z-index:3!important;
}
body[data-portal="staff"] .staff-entry-form,
body[data-portal="staff"] .mobile-form,
body[data-portal="staff"] .drawer-form,
body[data-portal="staff"] .v24b-staff-form{
  display:grid!important;
  gap:14px!important;
}
body[data-portal="staff"] .staff-entry-form h2,
body[data-portal="staff"] .drawer-form h2{
  font-size:clamp(28px,4vw,44px)!important;
  margin:0!important;
  letter-spacing:-.035em!important;
}
body[data-portal="staff"] .form-row{
  display:grid!important;
  gap:8px!important;
}
body[data-portal="staff"] .form-row label,
body[data-portal="staff"] .drawer-form label{
  font-size:13px!important;
  color:var(--muted)!important;
  font-weight:900!important;
}
body[data-portal="staff"] .form-row input,
body[data-portal="staff"] .form-row select,
body[data-portal="staff"] .form-row textarea,
body[data-portal="staff"] .drawer-form input,
body[data-portal="staff"] .drawer-form select,
body[data-portal="staff"] .drawer-form textarea{
  width:100%!important;
  border:1px solid var(--line)!important;
  border-radius:16px!important;
  padding:13px!important;
  background:#fff!important;
  color:var(--ink)!important;
  outline:none!important;
}
body[data-portal="staff"] .two-col-form{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:14px!important;
}
body[data-portal="staff"] .upload-zone,
body[data-portal="staff"] .shipment-item-builder,
body[data-portal="staff"] .sea-pallet-box,
body[data-portal="staff"] .smart-extra{
  border:1px solid var(--line)!important;
  background:#fff!important;
  border-radius:22px!important;
  padding:16px!important;
  box-shadow:0 8px 24px rgba(6,27,58,.04)!important;
}
body[data-portal="staff"] .shipment-item-rows,
body[data-portal="staff"] .pallet-fields{display:grid!important;gap:10px!important}
body[data-portal="staff"] .shipment-product-row{
  display:grid!important;
  grid-template-columns:minmax(120px,.8fr) minmax(160px,1.2fr) minmax(110px,.8fr) minmax(120px,1fr) auto!important;
  gap:8px!important;
  align-items:center!important;
  background:#f8fbff!important;
  border:1px solid var(--line)!important;
  border-radius:16px!important;
  padding:10px!important;
}
body[data-portal="staff"] .pallet-box,
body[data-portal="staff"] [data-pallet-box]{
  background:#fff!important;
  border:1px solid #d9e7f8!important;
  border-left:6px solid var(--blue)!important;
  border-radius:22px!important;
  padding:14px!important;
  box-shadow:0 8px 24px rgba(6,27,58,.04)!important;
}
body[data-portal="staff"] .big-mobile-btn{width:max-content;min-width:220px;justify-self:start;padding:14px 18px!important;border-radius:18px!important}
body[data-portal="staff"] .field-hint{display:block;color:var(--muted);font-size:12px;line-height:1.4;margin-top:5px}

@media(max-width:1100px){
  body[data-portal="client"] .partner-finance-dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}
  body[data-portal="staff"] .staff-action-strip,
  body[data-portal="staff"] .staff-mini-balloons{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:900px){
  body[data-portal="client"] .partner-finance-hero,
  body[data-portal="staff"] .staff-app-hero,
  body[data-portal="staff"] .manager-hero{display:grid!important}
  body[data-portal="client"] .partner-finance-control{grid-template-columns:1fr}
  body[data-portal="client"] .partner-finance-project-table summary{grid-template-columns:1fr}
  body[data-portal="staff"] .workspace-header{grid-template-columns:1fr!important}
  body[data-portal="staff"] .two-col-form{grid-template-columns:1fr!important}
  body[data-portal="staff"] .shipment-product-row{grid-template-columns:1fr!important}
}
@media(max-width:560px){
  body[data-portal="client"] .partner-finance-dashboard,
  body[data-portal="staff"] .staff-action-strip,
  body[data-portal="staff"] .staff-mini-balloons{grid-template-columns:1fr!important}
  body[data-portal="staff"] .drawer.open{padding:8px!important;place-items:end center!important}
  body[data-portal="staff"] .drawer-panel{width:100%!important;border-radius:28px 28px 0 0!important;max-height:92vh!important;padding:20px!important}
  body[data-portal="staff"] .big-mobile-btn{width:100%;min-width:0}
}
