/* Opportunity workspace. Scoped to the existing table and dossier controls. */
.panel:has(#opportunity-rows){
  --op-line:rgba(111,151,193,.18);
  background:linear-gradient(145deg,rgba(250,253,255,.94),rgba(234,244,255,.84));
  border:1px solid rgba(255,255,255,.88);
  border-radius:24px;
  box-shadow:0 10px 36px rgba(43,82,126,.045),inset 0 1px 0 #fff;
}
.desk-shell .panel:has(#opportunity-rows)>.panel-heading{padding:25px 27px 22px;gap:18px;border-color:var(--op-line)}
.desk-shell .panel:has(#opportunity-rows) .panel-heading h2{font-size:20px;line-height:1.3;letter-spacing:-.6px;font-weight:620;color:#19344f}
.panel:has(#opportunity-rows) .panel-heading p{font-size:11px;line-height:1.65;color:#66809a;margin-top:7px}
.panel:has(#opportunity-rows) .toolbar{padding:16px 24px;gap:10px;background:#e9f3fd5c;border-color:var(--op-line)}
.panel:has(#opportunity-rows) .search input,.panel:has(#opportunity-rows) select{min-height:42px;background:#ffffffd6;border:1px solid #b4cbe25c;border-radius:12px;font-size:12px;color:#31516e;box-shadow:0 2px 3px #375d7f03}
.panel:has(#opportunity-rows) .search svg{top:13px;color:#7893af}
.panel:has(#opportunity-rows) .search input{padding-left:35px}
.desk-shell .panel:has(#opportunity-rows) .data-table th{padding:15px 18px;background:#dbeaf838;color:#6c839b;font-size:10px;letter-spacing:.03em;line-height:1.5;border-color:var(--op-line);font-weight:550;white-space:nowrap}
.desk-shell .panel:has(#opportunity-rows) .data-table td{padding:20px 18px;border-color:var(--op-line);font-size:12px;color:#34516d;font-variant-numeric:tabular-nums;line-height:1.45}
.panel:has(#opportunity-rows) .data-table tbody tr{transition:background .18s,box-shadow .18s}
.panel:has(#opportunity-rows) .data-table tbody tr:hover{background:#ffffffb8;box-shadow:inset 3px 0 0 #78a8e9}
.panel:has(#opportunity-rows) .data-table tbody tr:has(input:checked){background:#dbeaff99;box-shadow:inset 3px 0 0 #4e8bd7}
.panel:has(#opportunity-rows) input[type=checkbox]{width:16px;height:16px;accent-color:#548fe0;cursor:pointer}
.desk-shell .panel:has(#opportunity-rows) .data-table .company-name{gap:12px;min-width:190px;font-size:13px;font-weight:610;color:#1c3854;text-decoration:none;line-height:1.4}
.desk-shell .panel:has(#opportunity-rows) .data-table .company-name:hover{color:#397bc7}
.desk-shell .panel:has(#opportunity-rows) .data-table .company-name small{font-size:10px;font-weight:400;color:#7b90a6;margin-top:5px}
.desk-shell .panel:has(#opportunity-rows) .data-table .company-glyph{width:38px;height:42px;border-radius:12px;background:linear-gradient(150deg,#fff,#dbeafa);border:1px solid #fff;color:#547da9;font-family:inherit;font-weight:520;font-size:17px;box-shadow:0 3px 7px #47698d0a}
.panel:has(#opportunity-rows) .tag,#drawer:has(#analysis-note) .tag{border-radius:100px;padding:5px 9px;font-size:10px;font-weight:520;border:1px solid #c7d8e23d;background:#e9f0f6;color:#54718a}
.panel:has(#opportunity-rows) .tag.good,#drawer:has(#analysis-note) .tag.good{color:#277962;background:#e0f1eac9;border-color:#b4ddcc5e}
.panel:has(#opportunity-rows) .tag.warn,#drawer:has(#analysis-note) .tag.warn{color:#946421;background:#fff1d9c4;border-color:#eed6a65c}
.panel:has(#opportunity-rows) .tag.bad,#drawer:has(#analysis-note) .tag.bad{color:#a26668;background:#f7e6e6b3;border-color:#eac6c64a}
.panel:has(#opportunity-rows) .data-table td:last-child .icon-btn{width:31px;height:31px;background:#ffffffa1;border:1px solid #b9cee456;border-radius:50%;color:#6486ab;transition:transform .18s,background .18s}
.panel:has(#opportunity-rows) .data-table td:last-child .icon-btn:hover{background:#e4efff;transform:translateX(2px)}
.panel:has(#opportunity-rows) .panel-foot{padding:17px 24px;background:#e7f1fa55;border-color:var(--op-line);font-size:10px;color:#7990a5;gap:12px}
.panel:has(#opportunity-rows) .data-table td.empty{padding:45px 20px;text-align:center;color:#6d87a0}

/* Dossier: a readable, full-height research sheet with a clear decision area. */
#drawer:has(#analysis-note){width:min(820px,calc(100% - 40px));max-height:calc(100dvh - 48px);border:1px solid #fff;border-radius:27px;background:linear-gradient(150deg,#f8fcff,#edf5fd);box-shadow:0 35px 120px #163d6952;color:#24425f}
#drawer:has(#analysis-note)::backdrop{background:#173b5c4a;backdrop-filter:blur(12px) saturate(.85)}
#drawer:has(#analysis-note) .dialog-header{padding:25px 32px;background:#f6fbfff2;backdrop-filter:blur(20px);border-bottom:1px solid #afc7df3f;z-index:2}
#drawer:has(#analysis-note) .dialog-header h2{font-family:inherit;font-size:29px;font-weight:620;letter-spacing:-1px;color:#15334f;line-height:1.22}
#drawer:has(#analysis-note) .dialog-header .icon-btn{width:35px;height:35px;flex-shrink:0;border-radius:50%;background:#e4eef8;border:1px solid #d6e5f0;color:#6283a1}
#drawer:has(#analysis-note) .dialog-body{padding:26px 32px 30px}
#drawer:has(#analysis-note) .dialog-body>.inline-row:first-child{gap:7px}
#drawer:has(#analysis-note) .legal-note{font-size:10px;color:#7890a6;line-height:1.7;margin-top:15px}
#drawer:has(#analysis-note) .detail-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:30px}
#drawer:has(#analysis-note) .detail-cell{min-height:105px;padding:18px 15px;border-radius:16px;background:linear-gradient(140deg,#fff,#e6f1fd);border:1px solid #ffffff;box-shadow:0 4px 15px #315d9205;font-size:23px;letter-spacing:-.65px;color:#204563;font-weight:550;font-variant-numeric:tabular-nums}
#drawer:has(#analysis-note) .detail-cell:first-child{background:linear-gradient(135deg,#dcecff,#eef6ff);color:#22588b}
#drawer:has(#analysis-note) .detail-cell small{font-size:10px;font-weight:450;color:#708aa4;line-height:1.4;letter-spacing:0;margin-bottom:13px}
#drawer:has(#analysis-note) .dialog-body>h3{font-size:16px;letter-spacing:-.3px;font-weight:610;color:#214461;margin:29px 0 15px}
#drawer:has(#analysis-note) .checks{padding:3px 17px;margin:0 0 26px;background:#ffffff82;border:1px solid #c6daeb6e;border-radius:16px}
#drawer:has(#analysis-note) .check-row{padding:12px 0;border-color:#b8cde53d;font-size:12px;gap:14px}
#drawer:has(#analysis-note) .check-row:last-child{border-bottom:0}
#drawer:has(#analysis-note) .source-block{background:#ffffffa8;border:1px solid #c9dceb91;border-left:3px solid #83a9d5;border-radius:5px 14px 14px 5px;padding:18px 20px;margin:12px 0;font-size:12px;line-height:1.75;color:#355671}
#drawer:has(#analysis-note) .source-block small{font-size:10px;color:#8095a9;line-height:1.6;margin:7px 0}
#drawer:has(#analysis-note) .source-block blockquote{font-size:13px;line-height:1.8;color:#294965;margin:11px 0 3px}
#drawer:has(#analysis-note) .source-block b{font-weight:600}
#drawer:has(#analysis-note) .note-box{background:#fff4de8c;border:1px solid #ead3a85c;border-radius:13px;color:#866737;font-size:12px;padding:15px 18px;line-height:1.8;margin:17px 0}
#drawer:has(#analysis-note) details{border-block:1px solid #b9cee54f;margin:21px 0 28px;padding:16px 0}
#drawer:has(#analysis-note) details summary{display:list-item;cursor:pointer;color:#53789c;font-size:12px;text-decoration:none;list-style-position:inside;padding:2px 0}
#drawer:has(#analysis-note) details[open] summary{margin-bottom:16px}
#drawer:has(#analysis-note) .form-field{margin:21px 0}
#drawer:has(#analysis-note) .form-field label{font-size:12px;font-weight:550;color:#456681;margin-bottom:10px}
#drawer:has(#analysis-note) .form-field select,#drawer:has(#analysis-note) .form-field textarea{width:100%;border:1px solid #bfd3e6;background:#ffffffc7;border-radius:12px;font-family:inherit;font-size:13px;padding:13px 15px;color:#264b6c;line-height:1.7}
#drawer:has(#analysis-note) .form-field textarea{min-height:128px;resize:vertical}
#drawer:has(#analysis-note) .form-field textarea::placeholder{color:#96a8ba}
#drawer:has(#analysis-note) .dialog-body>.inline-row:has([data-save-note]){border-top:1px solid #b8cde54f;padding-top:22px;margin-top:25px;gap:11px}
#drawer:has(#analysis-note) .btn{border-radius:11px;min-height:43px;font-size:12px;padding:11px 17px;border-color:#c8d8e9;color:#4b6b89;background:#ffffffb8}
#drawer:has(#analysis-note) .btn.primary{background:#234d78;border-color:#234d78;color:white;box-shadow:0 5px 13px #1c4c7a1a}

/* Comparison keeps the same restrained hierarchy as the source dossier. */
#drawer:has(.comparison){border-radius:24px;background:#f1f7fd;border-color:#fff}
#drawer:has(.comparison) .dialog-header{background:#f5faff;border-color:#c3d5e750}
#drawer:has(.comparison) .dialog-header h2{font-family:inherit;font-size:24px;letter-spacing:-.7px;color:#254866}
#drawer:has(.comparison) .compare-card{border:1px solid #c1d5e670;background:#fff9;border-radius:17px}
#drawer:has(.comparison) .compare-card h3{font-family:inherit;background:linear-gradient(145deg,#dfedfc,#eff7ff);font-size:20px;letter-spacing:-.45px;color:#315779;padding:22px;line-height:1.25;min-height:92px;margin:0}
#drawer:has(.comparison) .compare-card dl{padding:3px 22px}
#drawer:has(.comparison) .compare-card dt{font-size:10px;color:#8094a8}
#drawer:has(.comparison) .compare-card dd{font-size:15px;color:#31516d;border-bottom:1px solid #dae5ef;padding-bottom:13px;margin-bottom:17px;font-variant-numeric:tabular-nums}

@media(max-width:1100px){
  .desk-shell .panel:has(#opportunity-rows) .data-table td,.desk-shell .panel:has(#opportunity-rows) .data-table th{padding-left:13px;padding-right:13px}
  .desk-shell .panel:has(#opportunity-rows) .panel-heading h2{font-size:18px}
}
@media(max-width:600px){
  .panel:has(#opportunity-rows){border-radius:19px}
  .desk-shell .panel:has(#opportunity-rows)>.panel-heading{padding:20px 18px}
  .panel:has(#opportunity-rows) .toolbar{padding:13px;gap:8px}
  .panel:has(#opportunity-rows) .toolbar select{flex:1;min-width:0;width:calc(50% - 4px);font-size:11px}
  .panel:has(#opportunity-rows) .data-table{display:block;min-width:0;width:100%}
  .panel:has(#opportunity-rows) .data-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .panel:has(#opportunity-rows) .data-table tbody{display:grid;gap:10px;padding:12px}
  .panel:has(#opportunity-rows) .data-table tbody tr{display:grid;grid-template-columns:1fr 1fr;gap:12px;position:relative;padding:16px;border:1px solid #d3e2f08c;background:#ffffff91;border-radius:15px}
  .desk-shell .panel:has(#opportunity-rows) .data-table td{display:block;padding:0;border:0;font-size:12px;min-width:0}
  .panel:has(#opportunity-rows) .data-table td:nth-last-child(6){grid-column:1/-1;padding-right:28px;padding-bottom:12px;border-bottom:1px solid #d1e1ee73}
  .desk-shell .panel:has(#opportunity-rows) .data-table .company-name{min-width:0;font-size:13px;max-width:100%}
  .desk-shell .panel:has(#opportunity-rows) .data-table .company-name>span:last-child{overflow-wrap:anywhere}
  .panel:has(#opportunity-rows) .data-table td:has(input[data-select]){position:absolute;right:15px;top:21px}
  .panel:has(#opportunity-rows) .data-table td:nth-last-child(5)::before{content:'Paese'}
  .panel:has(#opportunity-rows) .data-table td:nth-last-child(4)::before{content:'Ticket equity'}
  .panel:has(#opportunity-rows) .data-table td:nth-last-child(3)::before{content:'Ricavi contratt.'}
  .panel:has(#opportunity-rows) .data-table td:nth-last-child(2)::before{content:'Screening'}
  .panel:has(#opportunity-rows) .data-table td:nth-last-child(n+2):nth-last-child(-n+5)::before{display:block;font-size:9px;letter-spacing:.02em;color:#8a9eb1;margin-bottom:5px}
  .panel:has(#opportunity-rows) .data-table td:last-child:not(.empty){position:absolute;right:15px;bottom:15px;display:none}
  .panel:has(#opportunity-rows) .data-table td.empty{grid-column:1/-1;padding:20px 0;line-height:1.7}
  .panel:has(#opportunity-rows) .panel-foot{padding:14px 17px;flex-wrap:wrap;font-size:9px;gap:5px}
  #drawer:has(#analysis-note){width:calc(100% - 16px);max-height:calc(100dvh - 16px);border-radius:21px}
  #drawer:has(#analysis-note) .dialog-header{padding:20px}
  #drawer:has(#analysis-note) .dialog-header h2{font-size:24px;letter-spacing:-.75px}
  #drawer:has(#analysis-note) .dialog-body{padding:21px 20px 24px}
  #drawer:has(#analysis-note) .detail-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #drawer:has(#analysis-note) .detail-cell{font-size:23px;min-height:95px;padding:16px}
  #drawer:has(#analysis-note) .source-block{padding:15px 16px}
  #drawer:has(#analysis-note) .checks{padding-inline:13px}
  #drawer:has(#analysis-note) .check-row{font-size:11px}
  #drawer:has(#analysis-note) .check-row .tag{font-size:9px;white-space:normal;text-align:center;max-width:52%;flex-shrink:0}
}
@media(prefers-reduced-motion:reduce){
  .panel:has(#opportunity-rows) .data-table tbody tr,.panel:has(#opportunity-rows) .data-table td:last-child .icon-btn{transition:none}
}
@media print{
  #drawer:has(#analysis-note){box-shadow:none;background:white;border:0;max-height:none;width:100%}
  #drawer:has(#analysis-note) .dialog-header{position:static;background:white}
  #drawer:has(#analysis-note) .source-block,#drawer:has(#analysis-note) .detail-cell,#drawer:has(#analysis-note) .check-row{break-inside:avoid}
}
