/* DIE2HARD Studio 1.19 — Business (finance, legal papers, clients, access). Built on the Studio 2.0 page system
   (studio-project.css): same tokens, buttons, rows and tabs. Only what Business needs on top. Phone first. */
#mainNav [data-view="business"][hidden]{display:none!important}
#workspace .p2-biz *{text-transform:none;letter-spacing:normal}
#workspace .p2-biz .p2-title{max-width:none}
#workspace .p2-biz .p2-home-top .p2-primary{width:auto}
#workspace .p2-biz .p2-sec-head h2{font-size:18px}
#workspace .p2-biz [hidden]{display:none!important}

/* ---------- loading */
#workspace .p2-biz .biz-skel{display:grid;gap:12px;margin-top:18px}
#workspace .p2-biz .biz-skel i{display:block;height:72px;border-radius:var(--p2-r);background:linear-gradient(90deg,var(--p2-line-2) 25%,#f4efe7 50%,var(--p2-line-2) 75%);background-size:200% 100%;animation:bizPulse 1.4s ease-in-out infinite}
@keyframes bizPulse{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* ---------- segmented choice (year, kind of paper, access level) */
#workspace .p2-biz .biz-seg{display:inline-flex;flex-wrap:wrap;max-width:100%;gap:2px;padding:3px;border-radius:999px;border:1px solid var(--p2-line);background:var(--p2-surface)}
#workspace .p2-biz .biz-seg button{min-height:40px;padding:0 16px;border:0;border-radius:999px;background:none;color:var(--p2-soft);font-size:14.5px;font-weight:600;cursor:pointer}
#workspace .p2-biz .biz-seg button.on{background:var(--p2-ink);color:var(--p2-paper)}
#workspace .p2-biz .biz-seg button:disabled{opacity:.6;cursor:default}
#workspace .p2-biz .biz-years{margin:18px 0 0}

/* ---------- the four numbers */
#workspace .p2-biz .biz-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:18px}
#workspace .p2-biz .biz-kpis>div{display:grid;gap:3px;align-content:start;padding:14px 16px;border:1px solid var(--p2-line);border-radius:var(--p2-r);background:var(--p2-surface);min-width:0}
#workspace .p2-biz .biz-kpis span{color:var(--p2-muted);font-size:13.5px;font-weight:600}
#workspace .p2-biz .biz-kpis b{font-family:var(--p2-display);font-size:clamp(26px,7vw,34px);line-height:1.05;overflow-wrap:anywhere}
#workspace .p2-biz .biz-kpis small{color:var(--p2-muted);font-size:12.5px;line-height:1.35}
#workspace .p2-biz .biz-kpis .is-owed{border-color:var(--p2-orange);background:#fff3ea}
#workspace .p2-biz .biz-kpis .is-owed b{color:var(--p2-orange-ink)}

/* ---------- received per month */
#workspace .p2-biz .biz-chart{margin:0;padding:14px 12px 10px;border:1px solid var(--p2-line);border-radius:var(--p2-r);background:var(--p2-surface)}
#workspace .p2-biz .biz-chart ul{list-style:none;margin:0;padding:0;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);align-items:end;gap:6px;height:150px}
#workspace .p2-biz .biz-chart li{position:relative;display:grid;grid-template-rows:16px 1fr 18px;align-items:end;justify-items:center;height:100%;min-width:0}
#workspace .p2-biz .biz-chart li i{display:block;width:100%;max-width:28px;border-radius:6px 6px 2px 2px;background:var(--p2-orange);align-self:end}
#workspace .p2-biz .biz-bar-val{font-size:11px;font-weight:650;color:var(--p2-soft);white-space:nowrap}
#workspace .p2-biz .biz-bar-lab{font-size:11px;color:var(--p2-muted);text-transform:capitalize}

/* ---------- lists of things */
#workspace .p2-biz .biz-list{display:grid;border-top:1px solid var(--p2-line)}
#workspace .p2-biz .biz-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;width:100%;min-height:68px;padding:12px 2px;border:0;border-bottom:1px solid var(--p2-line);border-radius:0;background:none;color:var(--p2-ink);text-align:left;cursor:pointer;font:inherit}
#workspace .p2-biz .biz-row:active{background:rgba(22,21,19,.045)}
#workspace .p2-biz .biz-row>svg{color:var(--p2-muted)}
#workspace .p2-biz .biz-row-main{min-width:0;display:grid;gap:3px}
#workspace .p2-biz .biz-row-main b{font-size:15.5px;font-weight:650;overflow-wrap:anywhere}
#workspace .p2-biz .biz-row-main small{font-size:13.5px;line-height:1.4;color:var(--p2-muted)}
#workspace .p2-biz .biz-row-side{display:grid;justify-items:end;gap:4px}
#workspace .p2-biz .biz-row-side .p2-pill{margin:0}
#workspace .p2-biz .biz-bar{display:block;height:4px;border-radius:4px;background:var(--p2-line-2);margin:5px 0 1px;overflow:hidden;max-width:240px}
#workspace .p2-biz .biz-bar i{display:block;height:100%;background:var(--p2-green);border-radius:4px}
#workspace .p2-biz .biz-pill{height:24px;font-size:12px}
#workspace .p2-biz .biz-pill.is-owed{background:#fde3d3;color:var(--p2-orange-ink)}
#workspace .p2-biz .biz-pill.is-unknown{background:transparent;border:1px dashed var(--p2-line);color:var(--p2-muted)}
#workspace .p2-biz .biz-pill.is-muted{background:var(--p2-line-2);color:var(--p2-muted)}
#workspace .p2-biz .biz-alert{margin:16px 0 0;padding:11px 14px;border-radius:12px;background:#fde3d3;color:var(--p2-orange-ink);font-size:14px;font-weight:600;line-height:1.45}
#workspace .p2-biz .biz-foot{display:grid;gap:10px;justify-items:start;margin-top:30px;padding-top:14px;border-top:1px solid var(--p2-line)}
#workspace .p2-biz .biz-foot .p2-hint{margin:0}
#workspace .p2-biz .biz-actions{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 0}
#workspace .p2-biz .biz-search{width:100%;min-height:46px;margin:0 0 10px;padding:0 14px;border:1px solid var(--p2-line);border-radius:12px;background:var(--p2-surface);color:var(--p2-ink);font:16px var(--p2-sans)}
#workspace .p2-biz .biz-search:focus{outline:2px solid var(--p2-orange);outline-offset:1px}

/* ---------- one client */
#workspace .p2-biz .biz-clienthead{display:grid;gap:6px;margin-top:6px}
#workspace .p2-biz .biz-client-name{font-family:var(--p2-display);font-weight:700;font-size:clamp(28px,7.5vw,42px);line-height:1;overflow-wrap:anywhere;margin:2px 0 0}
#workspace .p2-biz .biz-dl{display:grid;gap:0;margin:0;border-top:1px solid var(--p2-line)}
#workspace .p2-biz .biz-dl>div{display:grid;grid-template-columns:minmax(110px,32%) minmax(0,1fr);gap:12px;padding:11px 2px;border-bottom:1px solid var(--p2-line)}
#workspace .p2-biz .biz-dl dt{color:var(--p2-muted);font-size:13.5px;font-weight:600}
#workspace .p2-biz .biz-dl dd{margin:0;font-size:15px;overflow-wrap:anywhere;white-space:pre-wrap}
#workspace .p2-biz .biz-dl .is-owed dd{color:var(--p2-orange-ink);font-weight:700}

/* ---------- who can see what */
#workspace .p2-biz .biz-people{display:grid;gap:12px}
#workspace .p2-biz .biz-person{display:grid;gap:14px;padding:14px 16px;border:1px solid var(--p2-line);border-radius:var(--p2-r);background:var(--p2-surface)}
#workspace .p2-biz .biz-person header{display:flex;align-items:center;gap:12px}
#workspace .p2-biz .biz-person header div{display:grid;gap:1px;min-width:0}
#workspace .p2-biz .biz-person header b{font-size:16px;font-weight:650;overflow-wrap:anywhere}
#workspace .p2-biz .biz-person header small{font-size:13.5px;color:var(--p2-muted)}
#workspace .p2-biz .biz-ava{display:grid;place-items:center;flex:none;width:42px;height:42px;border-radius:50%;background:#e7e0d7;border:1px solid var(--p2-line);font:700 14px/1 var(--p2-sans)}
#workspace .p2-biz .biz-levels{display:grid;gap:12px}
#workspace .p2-biz .biz-level{display:grid;gap:6px}
#workspace .p2-biz .biz-level>span{font-size:14px;font-weight:600;color:var(--p2-soft)}
#workspace .p2-biz .biz-level .biz-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
#workspace .p2-biz .biz-level .biz-seg button{padding:0 4px;font-size:13.5px;line-height:1.15;text-align:center;white-space:normal;overflow-wrap:anywhere;min-width:0}

/* ---------- a project: contract and rights */
#workspace .biz-proj .biz-line{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}
#workspace .biz-proj .p2-pill{margin:0}
#workspace .biz-proj .p2-pill.is-unknown{background:transparent;border:1px dashed var(--p2-line);color:var(--p2-muted)}
#workspace .biz-proj .p2-pill.is-muted{background:var(--p2-line-2);color:var(--p2-muted)}
#workspace .biz-proj .biz-note{font-size:13.5px;color:var(--p2-muted)}
#workspace .biz-proj .biz-warn{margin-top:2px;font-size:13.5px;line-height:1.4;color:var(--p2-orange-ink)}

/* ---------- dialogs (the shared dark sheet) */
dialog#modal .biz-fin{display:grid;gap:14px}
dialog#modal .biz-fin .d19-lead{margin:0}
dialog#modal .biz-dl{display:grid;margin:0;border-top:1px solid rgba(255,255,255,.12)}
dialog#modal .biz-dl>div{display:grid;grid-template-columns:minmax(110px,40%) minmax(0,1fr);gap:12px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.12)}
dialog#modal .biz-dl dt{color:var(--d19-muted,#a49d93);font-size:13.5px}
dialog#modal .biz-dl dd{margin:0;font-size:15px;font-weight:600;overflow-wrap:anywhere;white-space:pre-wrap}
dialog#modal .biz-dl .is-owed dd{color:#ffb78a}
dialog#modal .biz-dl .is-got dd{color:#8fd19a}
dialog#modal .biz-h3{margin:6px 0 0;font:600 12px var(--mono,monospace);letter-spacing:.12em;text-transform:uppercase;color:var(--d19-muted,#a49d93)}
dialog#modal .biz-subform{margin-top:8px;padding-top:14px;border-top:1px solid rgba(255,255,255,.12)}
dialog#modal .biz-pays{list-style:none;margin:0;padding:0;display:grid}
dialog#modal .biz-pays li{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:54px;border-bottom:1px solid rgba(255,255,255,.1)}
dialog#modal .biz-pays li span{display:grid;gap:2px;min-width:0}
dialog#modal .biz-pays small{font-size:12.5px;color:var(--d19-muted,#a49d93)}
dialog#modal .biz-x{min-height:40px;padding:0 12px;border:0;background:none;color:#ff9d95;font:600 14px var(--sans,inherit);cursor:pointer}
dialog#modal .biz-warnline{color:#ffb78a}
dialog#modal .biz-tpl{width:100%;box-sizing:border-box;min-height:300px;padding:12px;border-radius:12px;font:13px/1.5 var(--mono,monospace);white-space:pre-wrap}
dialog#modal .biz-upload{position:relative;display:inline-flex;overflow:hidden}
dialog#modal .biz-upload input{position:absolute;inset:0;opacity:0;cursor:pointer}
dialog#modal .biz-fileline{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 10px}
dialog#modal .biz-del{margin-right:auto}

@media (min-width:700px){
  #workspace .p2-biz .biz-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
  /* 1.19.1: one person per card, the three levels stacked inside it. Three levels side by side (each with its own three-button
     control) put nine buttons on a ~330 px card on a tablet and the words ran into each other. */
  #workspace .p2-biz .biz-people{grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr))}
  #workspace .p2-biz .biz-person{align-content:start}
}
@media (max-width:650px),(pointer:coarse) and (max-height:500px) and (max-width:1000px){
  #workspace .p2-biz .biz-row{min-height:72px}
  #workspace .p2-biz .biz-dl>div{grid-template-columns:1fr;gap:2px}
  dialog#modal .biz-dl>div{grid-template-columns:1fr;gap:2px}
}
@media (prefers-reduced-motion:reduce){#workspace .p2-biz .biz-skel i{animation:none}}
@media print{#workspace .p2-biz .p2-primary,#workspace .p2-biz .biz-foot a{display:none!important}}
/* links that look like buttons (WhatsApp / call / email) */
#workspace .p2-page a.p2-secondary,#workspace .p2-page a.p2-primary{text-decoration:none}
dialog#modal a.secondary.v115-wa-invite{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 18px;text-decoration:none}
