/* RC72 - Tabelle mobile compatte e leggibili, solo UI */
:root{
  --rc72-open:#e8f4ff;
  --rc72-open-strong:#d7ecff;
  --rc72-closed:#ffffff;
  --rc72-line:#d9e1ea;
  --rc72-text:#122033;
  --rc72-muted:#607085;
  --rc72-blue:#0b67a3;
  --rc72-red:#dc2626;
  --rc72-orange:#f59e0b;
  --rc72-green:#16a34a;
  --rc72-gray:#64748b;
}

/* desktop/tablet: più chiaro, meno spazi vuoti */
table:not(.detail-table):not(.wo-mini):not(.wo-lines){
  border-collapse:separate!important;
  border-spacing:0!important;
  width:100%!important;
  font-size:14px!important;
}
table:not(.detail-table):not(.wo-mini):not(.wo-lines) th{
  background:#f3f7fb!important;
  color:#364357!important;
  border-bottom:1px solid var(--rc72-line)!important;
  padding:10px 10px!important;
  font-size:12px!important;
  letter-spacing:.03em!important;
  text-transform:uppercase!important;
}
table:not(.detail-table):not(.wo-mini):not(.wo-lines) td{
  padding:9px 10px!important;
  border-bottom:1px solid #edf1f5!important;
  color:var(--rc72-text)!important;
  vertical-align:middle!important;
}

.calls-table tr.ui-status-open td,
.calls-open-table tr:not(:first-child) td{
  background:var(--rc72-open)!important;
}
.calls-table tr.ui-status-closed td,
.calls-table tr.ui-status-da-fatturare td,
.calls-table tr.ui-status-fatturata td,
.calls-billing-table tr:not(:first-child) td{
  background:var(--rc72-closed)!important;
}
.calls-table tr:hover td{filter:brightness(.985)!important}

.urgency-dot,
.rc72-urgency-dot{
  width:10px!important;height:10px!important;border-radius:999px!important;display:inline-block!important;
  margin-right:6px!important;vertical-align:0!important;border:2px solid #fff!important;box-shadow:0 0 0 1px rgba(15,23,42,.16)!important;
}
.urgency-dot.u1,.rc72-urgency-dot.u1{background:var(--rc72-red)!important}
.urgency-dot.u2,.rc72-urgency-dot.u2{background:var(--rc72-orange)!important}
.urgency-dot.u3,.rc72-urgency-dot.u3{background:var(--rc72-blue)!important}
.urgency-dot.u4,.rc72-urgency-dot.u4{background:var(--rc72-green)!important}

@media(max-width:760px){
  .card{padding:14px!important;border-radius:18px!important}
  .card h2{font-size:20px!important;margin-bottom:8px!important}
  .live-filter-wrap,.table-filter{margin-bottom:8px!important}
  .live-filter-wrap input,.table-filter,input.table-filter{height:42px!important;font-size:15px!important;border-radius:12px!important}

  /* Mantiene la tabella, ma la rende compatta: niente card verticali, scroll molto ridotto */
  .card{overflow:hidden!important}
  .card > table,
  section.card > table,
  .table-responsive > table{
    table-layout:fixed!important;
    width:100%!important;
    min-width:0!important;
  }
  .card:has(> table), section.card:has(> table){overflow-x:hidden!important}
  .card table th,.card table td,
  section.card table th,section.card table td{
    padding:7px 6px!important;
    font-size:12px!important;
    line-height:1.2!important;
    white-space:normal!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    word-break:normal!important;
  }

  /* Chiamate: mostra le informazioni utili in poco spazio */
  .calls-table{table-layout:fixed!important;border-radius:14px!important;overflow:hidden!important}
  .calls-table th:nth-child(1),.calls-table td:nth-child(1){width:26%!important}
  .calls-table th:nth-child(2),.calls-table td:nth-child(2){width:34%!important}
  .calls-table th:nth-child(5),.calls-table td:nth-child(5){width:14%!important;text-align:center!important}
  .calls-table th:nth-child(6),.calls-table td:nth-child(6){width:18%!important;text-align:center!important}
  .calls-table th:nth-child(3),.calls-table td:nth-child(3),
  .calls-table th:nth-child(4),.calls-table td:nth-child(4),
  .calls-table th:nth-child(7),.calls-table td:nth-child(7),
  .calls-table th:nth-child(8),.calls-table td:nth-child(8){display:none!important}
  .calls-table th:nth-child(1)::after{content:""}
  .calls-table td:nth-child(1) b{font-size:12px!important;letter-spacing:-.01em!important}
  .calls-table td:nth-child(2) b,.calls-table td:nth-child(2){font-size:12px!important;font-weight:700!important;color:#172033!important}
  .calls-table .badge,.calls-table .workflow-status{font-size:0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
  .calls-table .badge::after{font-size:11px!important;font-weight:800!important;color:#334155!important}
  .calls-table .badge.p1::after{content:"Urg.";color:var(--rc72-red)!important}
  .calls-table .badge.p2::after{content:"Alta";color:var(--rc72-orange)!important}
  .calls-table .badge.p3::after{content:"Norm.";color:var(--rc72-blue)!important}
  .calls-table .badge.p4::after{content:"Bassa";color:var(--rc72-green)!important}
  .calls-table .workflow-status{font-size:11px!important;font-weight:800!important;color:#475569!important;text-transform:capitalize!important;display:inline!important}
  .calls-table .urgency-dot{margin-right:0!important;width:11px!important;height:11px!important}

  /* Rapportini e tabelle simili: numero + cliente + stato/priorità, più stretto */
  table:not(.calls-table):not(.detail-table):not(.wo-mini):not(.wo-lines) th,
  table:not(.calls-table):not(.detail-table):not(.wo-mini):not(.wo-lines) td{padding:7px 6px!important}
  table:not(.calls-table):not(.detail-table):not(.wo-mini):not(.wo-lines) th:nth-child(n+5),
  table:not(.calls-table):not(.detail-table):not(.wo-mini):not(.wo-lines) td:nth-child(n+5){font-size:11px!important}
  table:not(.calls-table):not(.detail-table):not(.wo-mini):not(.wo-lines) .badge,
  table:not(.calls-table):not(.detail-table):not(.wo-mini):not(.wo-lines) .workflow-status{font-size:11px!important;padding:3px 6px!important;border-radius:999px!important}

  /* Colore stato applicato anche alle tabelle generiche tramite JS */
  tr.ui-status-open td{background:var(--rc72-open)!important}
  tr.ui-status-closed td,tr.ui-status-fatturata td,tr.ui-status-da-fatturare td{background:#fff!important}
  tr.ui-status-open td:first-child{box-shadow:inset 4px 0 0 var(--rc72-blue)!important}
  tr.ui-status-closed td:first-child,tr.ui-status-fatturata td:first-child,tr.ui-status-da-fatturare td:first-child{box-shadow:inset 4px 0 0 #d6dde6!important}

  .section-title-row{gap:8px!important;align-items:flex-start!important}
  .calls-split-note{font-size:12px!important;line-height:1.25!important}
}
