/* Borsari Cloud — solo backend. Non altera il sito pubblico o le stampe. */
@media screen {
  body.borsari-admin-ui { max-width:100%; overflow-x:clip; }
  body.borsari-admin-ui .wrap,
  body.borsari-admin-ui main,
  body.borsari-admin-ui .container,
  body.borsari-admin-ui .content,
  body.borsari-admin-ui .admin-content {
    max-width:none; min-width:0;
  }
  body.borsari-admin-ui .wrap { width:calc(100% - 32px); margin-inline:auto; }
  body.borsari-admin-ui .panel,
  body.borsari-admin-ui .card,
  body.borsari-admin-ui .notice {
    min-width:0; border-radius:12px; box-shadow:0 2px 12px rgba(16,47,85,.04);
  }
  body.borsari-admin-ui .grid,
  body.borsari-admin-ui .detail-grid,
  body.borsari-admin-ui .cards { min-width:0; }
  body.borsari-admin-ui :is(input,select,textarea) { max-width:100%; }
  body.borsari-admin-ui :is(.table-wrap,.table-responsive,.table-container) {
    max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch;
  }
  body.borsari-admin-ui table { max-width:100%; }
  body.borsari-admin-ui :is(th,td) { overflow-wrap:anywhere; }
  body.borsari-admin-ui :is(button,.btn,input[type=submit]) { min-height:38px; }
  body.borsari-admin-ui :is(button,.btn,a,input,select,textarea):focus-visible {
    outline:3px solid #3685d5; outline-offset:2px;
  }
}
@media screen and (max-width:900px) {
  body.borsari-admin-ui .wrap { width:calc(100% - 24px); }
  body.borsari-admin-ui :is(.grid,.detail-grid,.cards) {
    grid-template-columns:minmax(0,1fr);
  }
  body.borsari-admin-ui .stats {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body.borsari-admin-ui :is(.admin-title,.panel-head) {
    flex-wrap:wrap; gap:12px;
  }
}
@media screen and (max-width:520px) {
  body.borsari-admin-ui .stats { grid-template-columns:minmax(0,1fr); }
  body.borsari-admin-ui :is(.panel,.notice,.card) { padding:16px; }
  body.borsari-admin-ui :is(.admin-title h1,h1) { font-size:clamp(23px,6vw,32px); }
}

/* Tabelle operative: riparazioni e conto vendita */
@media screen and (min-width:901px) {
  body.borsari-admin-ui .wrap,
  body.borsari-admin-ui .page { max-width:none!important; width:calc(100% - 28px)!important; }
  body.borsari-admin-ui .table-scroll,
  body.borsari-admin-ui .af-table-scroll,
  body.borsari-admin-ui .af-other-table-scroll { width:100%; max-width:100%; min-width:0; box-sizing:border-box; }
  body.borsari-admin-ui .table-scroll > table,
  body.borsari-admin-ui .af-table-scroll > table,
  body.borsari-admin-ui .af-other-table-scroll > table {
    width:100%!important; min-width:0!important; table-layout:fixed!important;
  }
  body.borsari-admin-ui .table-scroll :is(th,td),
  body.borsari-admin-ui .af-table-scroll :is(th,td),
  body.borsari-admin-ui .af-other-table-scroll :is(th,td) {
    white-space:normal!important; overflow-wrap:anywhere; padding:9px 6px;
    vertical-align:middle; font-size:clamp(11px,.8vw,13px);
  }
  body.borsari-admin-ui .af-table-scroll :is(th,td):first-child,
  body.borsari-admin-ui .af-other-table-scroll :is(th,td):first-child {
    position:static!important; width:auto!important; min-width:0!important; box-shadow:none!important;
  }
  body.borsari-admin-ui .af-row-actions { flex-wrap:wrap; min-width:0; }
}
@media screen and (max-width:900px) {
  body.borsari-admin-ui .table-scroll,
  body.borsari-admin-ui .af-table-scroll,
  body.borsari-admin-ui .af-other-table-scroll {
    max-width:100%; overflow-x:auto; overscroll-behavior-x:contain;
  }
  body.borsari-admin-ui .af-table-scroll > table,
  body.borsari-admin-ui .af-other-table-scroll > table { min-width:980px; }
}

/* Voucher acquisiti: ripristina la tabella orizzontale, mantenendo lo spazio recuperato. */
body.borsari-admin-ui .voucher-wide .table-scroll {
  width:100%!important;max-width:100%!important;overflow-x:auto!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll table {
  display:table!important;width:100%!important;min-width:1050px!important;
  table-layout:auto!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll thead {display:table-header-group!important;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody {display:table-row-group!important;}
body.borsari-admin-ui .voucher-wide .table-scroll tr {display:table-row!important;}
body.borsari-admin-ui .voucher-wide .table-scroll th,
body.borsari-admin-ui .voucher-wide .table-scroll td {
  display:table-cell!important;width:auto!important;min-width:0!important;
  position:static!important;vertical-align:middle!important;
  padding:9px 7px!important;white-space:normal!important;overflow-wrap:anywhere!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll td::before {content:none!important;}
body.borsari-admin-ui .voucher-wide .actions {display:flex;flex-wrap:wrap;gap:4px;}

/* Voucher: il body ha già 250px di spazio per la sidebar.
   Annulla il secondo margine di 195px imposto dal template. */
@media screen and (min-width:1000px) {
  body.borsari-admin-ui.borsari-has-sidebar main.wrap.voucher-wide {
    margin-left:14px!important;
    margin-right:14px!important;
    width:calc(100% - 28px)!important;
    max-width:none!important;
    box-sizing:border-box!important;
  }
}

/* Voucher acquisiti: ogni record resta orizzontale, disposto su due righe. */
body.borsari-admin-ui .voucher-wide .table-scroll {overflow-x:visible!important;}
body.borsari-admin-ui .voucher-wide .table-scroll table {
  display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll thead {display:none!important;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody {display:block!important;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody tr {
  display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr));
  gap:0 12px;padding:12px 14px;margin:0 0 9px;border:1px solid #dce4ee;
  border-radius:9px;background:#fff;align-items:center;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td {
  display:block!important;min-width:0!important;width:auto!important;padding:5px 0!important;
  border:0!important;overflow-wrap:anywhere!important;white-space:normal!important;
  font-size:12px!important;line-height:1.4!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(1){grid-column:span 2;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(2){grid-column:span 2;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(3){grid-column:span 3;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(4){grid-column:span 2;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(5){grid-column:span 1;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(6){grid-column:span 2;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(7){grid-column:span 3;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(8){grid-column:span 4;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(9){grid-column:span 3;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(10){grid-column:span 2;}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(n+7){
  border-top:1px solid #edf1f5!important;margin-top:6px;padding-top:10px!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td::before {
  display:block!important;content:'';font-size:10px;font-weight:700;color:#64748b;
  margin-bottom:3px;text-transform:uppercase;letter-spacing:.025em;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(1)::before{content:'Stato';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(2)::before{content:'Cliente';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(3)::before{content:'Email';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(4)::before{content:'Ordine';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(5)::before{content:'Data';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(6)::before{content:'Tipo';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(7)::before{content:'Importo';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(8)::before{content:'Codice voucher';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(9)::before{content:'Azioni';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(10)::before{content:'Archivio';}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td .actions {display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:5px!important;}
@media(max-width:700px){
 body.borsari-admin-ui .voucher-wide .table-scroll tbody tr{grid-template-columns:repeat(6,minmax(0,1fr));}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(n){grid-column:span 3;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(3),
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(8){grid-column:span 6;}
}

/* Voucher: tipografia uniforme e azioni compatte, sempre due righe orizzontali. */
@media (min-width:701px) {
 body.borsari-admin-ui .voucher-wide .table-scroll tbody tr {
   grid-template-columns:repeat(16,minmax(0,1fr))!important;
   column-gap:12px!important;row-gap:7px!important;padding:13px 16px!important;
 }
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(1){grid-column:span 2!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(2){grid-column:span 3!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(3){grid-column:span 4!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(4){grid-column:span 2!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(5){grid-column:span 2!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(6){grid-column:span 3!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(7){grid-column:span 3!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(8){grid-column:span 5!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(9){grid-column:span 6!important;}
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(10){grid-column:span 2!important;}
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td {
 font-size:14px!important;line-height:1.45!important;color:#263448!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td::before {
 font-size:11px!important;line-height:1.3!important;color:#52647b!important;
 margin-bottom:5px!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(7) :is(b,strong,.amount,.badge) {
 font-size:15px!important;line-height:1.3!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td :is(button,.btn,a.btn) {
 font-size:12px!important;line-height:1.3!important;min-height:30px!important;
 padding:6px 9px!important;width:auto!important;max-width:100%!important;
 white-space:normal!important;overflow-wrap:normal!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td .actions {
 display:flex!important;flex-direction:row!important;align-items:center!important;
 justify-content:flex-start!important;gap:6px!important;
}
body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(9) :is(button,.btn,a.btn) {
 flex:0 0 auto!important;min-width:55px!important;
}

/* Voucher — barra comandi ordinata, senza pulsanti giganti o testi spezzati. */
body.borsari-admin-ui main.voucher-wide > .head {
  margin:16px 0 18px!important;gap:8px!important;
}
body.borsari-admin-ui main.voucher-wide > .head > div {width:100%;min-width:0;}
body.borsari-admin-ui main.voucher-wide > .head h1 {
  font-size:clamp(23px,2vw,29px)!important;line-height:1.2!important;margin:5px 0 12px!important;
}
body.borsari-admin-ui main.voucher-wide > .head > div > p:has(> a.btn) {
  display:flex!important;flex-wrap:nowrap!important;align-items:center!important;
  gap:5px!important;margin:0!important;padding:0 0 6px!important;
  max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;
  scrollbar-width:thin;
}
body.borsari-admin-ui main.voucher-wide > .head > div > p > a.btn {
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 auto!important;width:auto!important;min-width:0!important;
  min-height:32px!important;height:32px!important;box-sizing:border-box!important;
  padding:6px 9px!important;margin:0!important;border-radius:5px!important;
  font-size:12px!important;font-weight:600!important;line-height:18px!important;
  letter-spacing:0!important;white-space:nowrap!important;overflow-wrap:normal!important;
  text-align:center!important;text-decoration:none!important;
}
body.borsari-admin-ui main.voucher-wide .voucher-amount {
  font-size:15px!important;line-height:1.25!important;padding:6px 9px!important;
}
body.borsari-admin-ui main.voucher-wide .table-scroll tbody td:nth-child(9) .actions {
  flex-wrap:wrap!important;gap:5px!important;
}
body.borsari-admin-ui main.voucher-wide .table-scroll tbody td:nth-child(9) .actions :is(a.btn,button,.btn) {
  width:auto!important;min-width:0!important;min-height:30px!important;
  padding:5px 10px!important;font-size:12px!important;white-space:nowrap!important;
}

/* Voucher: seconda riga allineata sulla stessa linea di base. */
@media (min-width:701px) {
 body.borsari-admin-ui .voucher-wide .table-scroll tbody tr {
   align-items:stretch!important;row-gap:5px!important;
 }
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(n+7) {
   display:flex!important;flex-direction:column!important;justify-content:center!important;
   align-items:flex-start!important;align-self:stretch!important;
   margin-top:0!important;padding-top:12px!important;padding-bottom:8px!important;
 }
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(n+7)::before {
   display:none!important;
 }
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(7) {
   align-items:flex-end!important;
 }
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(9) .actions {
   display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;
   align-items:center!important;justify-content:flex-start!important;
   gap:7px!important;width:100%!important;
 }
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(9) .actions .smallform {
   display:flex!important;align-items:center!important;margin:0!important;
   width:auto!important;flex:0 0 auto!important;
 }
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(9) .actions :is(a.btn,button,.btn),
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(10) :is(button,.btn) {
   display:inline-flex!important;align-items:center!important;justify-content:center!important;
   height:36px!important;min-height:36px!important;min-width:66px!important;
   width:auto!important;margin:0!important;padding:7px 11px!important;
   font-size:12px!important;line-height:1!important;white-space:nowrap!important;
   box-sizing:border-box!important;
 }
 body.borsari-admin-ui .voucher-wide .table-scroll tbody td:nth-child(10) {
   align-items:flex-end!important;
 }
}
