/*
  ARV – UI (modern)
  - Scoped to .arv-* classes to avoid theme conflicts
  - No external fonts
*/

:root{
  --arv-bg: #f6f7fb;
  --arv-surface: #ffffff;
  --arv-surface-2: #fbfcfe;
  --arv-text: #0f172a;
  --arv-muted: #64748b;
  --arv-border: rgba(15, 23, 42, .12);
  --arv-border-2: rgba(15, 23, 42, .08);
  --arv-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --arv-shadow-2: 0 2px 8px rgba(15, 23, 42, .06);
  --arv-radius: 14px;
  --arv-radius-sm: 10px;
  --arv-radius-xs: 8px;

  --arv-primary: #2f6b3f;
  --arv-primary-2: #2a5e38;
  --arv-secondary: #3d5a80;
  --arv-danger: #a61b1b;

  --arv-focus: 0 0 0 4px rgba(47, 107, 63, .18);
}



/* Base reset (solo su componenti ARV) */
.arv-box, .arv-box *,
.arv-modal, .arv-modal *{
  box-sizing: border-box;
}

.arv-box{
  border: 1px solid var(--arv-border);
  background: var(--arv-surface);
  padding: 18px 18px;
  margin: 18px 0;
  border-radius: var(--arv-radius);
  box-shadow: var(--arv-shadow-2);
}

/* (opzionale) se la pagina è full-width, i box restano leggibili */
.arv-box{
  max-width: 1100px;
}

/* se il tema usa contenitori stretti, non forziamo centraggi aggressivi */
.arv-box{ margin-left:auto; margin-right:auto; }

.arv-box h2, .arv-box h3, .arv-box h4, .arv-box h5{
  margin: 0 0 12px 0;
  color: var(--arv-text);
  line-height: 1.2;
}
.arv-box h2{ font-size: clamp(18px, 2.2vw, 24px); }
.arv-box h3{ font-size: clamp(16px, 1.8vw, 20px); }
.arv-box p{ color: var(--arv-text); line-height: 1.55; }

.arv-muted{ opacity: 1; color: var(--arv-muted); font-size: 13px; }

.arv-link, .arv-box a:not(.arv-btn){
  color: var(--arv-primary);
  text-decoration: none;
  font-weight: 600;
}
.arv-link:hover, .arv-box a:not(.arv-btn):hover{ text-decoration: underline; }

/* Layout */
.arv-form{ margin-top: 12px; }
.arv-grid{ display:grid; gap: 14px; }
.arv-grid-1{ grid-template-columns: 1fr; }
.arv-grid-2{ grid-template-columns: 1fr 1fr; }
.arv-grid-3{ grid-template-columns: 1fr 1fr 1fr; }
.arv-grid-2-1{ grid-template-columns: 2fr 1fr; }
@media (max-width: 900px){
  .arv-grid-2, .arv-grid-3, .arv-grid-2-1{ grid-template-columns: 1fr; }
}

.arv-field{ display:flex; flex-direction:column; gap: 6px; }
.arv-label{
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--arv-muted);
}

.arv-input{
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--arv-border);
  border-radius: var(--arv-radius-sm);
  background: var(--arv-surface-2);
  color: var(--arv-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.arv-input::placeholder{ color: rgba(100,116,139,.9); }

.arv-input:focus{
  outline: none;
  border-color: rgba(47, 107, 63, .55);
  box-shadow: var(--arv-focus);
}

.arv-input-small{ padding: 8px 10px; font-size: 13px; border-radius: var(--arv-radius-xs); }

.arv-hint{ font-size: 12px; color: var(--arv-muted); }

.arv-actions{ margin-top: 12px; display:flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.arv-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--arv-primary);
  color: #fff;
  text-decoration:none;
  border: 1px solid rgba(0,0,0,.06);
  cursor:pointer;
  font-weight: 700;
  box-shadow: var(--arv-shadow-2);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, background .12s ease;
}
.arv-btn:hover{ transform: translateY(-1px); box-shadow: var(--arv-shadow); background: var(--arv-primary-2); color: #fff;text-decoration: none; }
.arv-btn:active{ transform: translateY(0); opacity: .92; }
.arv-btn:focus{ outline:none; box-shadow: var(--arv-shadow-2), var(--arv-focus); }

.arv-btn-secondary{ background: var(--arv-secondary); }
.arv-btn-secondary:hover{ background: rgba(61, 90, 128, .92); }

.arv-btn-danger{ background: var(--arv-danger); }
.arv-btn-danger:hover{ background: rgba(166, 27, 27, .92); }

.arv-btn-small{ padding: 7px 10px; font-size: 12px; border-radius: 10px; }

/* Flash / alert */
.arv-flash{
  padding: 12px 12px;
  border: 1px solid var(--arv-border);
  background: linear-gradient(180deg, rgba(47,107,63,.10), rgba(47,107,63,.04));
  border-left: 4px solid var(--arv-primary);
  border-radius: var(--arv-radius-sm);
  margin: 12px 0;
  color: var(--arv-text);
}

/* Tables */
.arv-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--arv-border);
  border-radius: var(--arv-radius);
  overflow: hidden;
  background: var(--arv-surface);
}
.arv-table thead th{
  padding: 12px 12px;
  text-align:left;
  font-size: 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--arv-muted);
  background: rgba(100,116,139,.08);
  border-bottom: 1px solid var(--arv-border);
}
.arv-table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--arv-border-2);
  color: var(--arv-text);
  vertical-align: top;
}
.arv-table tbody tr:nth-child(even) td{ background: rgba(100,116,139,.04); }
.arv-table tbody tr:hover td{ background: rgba(47,107,63,.06); }
.arv-table tbody tr:last-child td{ border-bottom: none; }

/* Se la tabella è troppo larga, abilita scroll orizzontale su mobile */
@media (max-width: 900px){
  .arv-table{ display:block; overflow-x:auto; -webkit-overflow-scrolling: touch; }
  .arv-table thead, .arv-table tbody, .arv-table tr{ width: 100%; }
}

.arv-miniform{ display:flex; gap: 10px; flex-wrap: wrap; align-items:center; margin-bottom: 10px; }

/* Documenti builder (radio/checkbox) */
.arv-doc-title{ margin: 14px 0 8px; }
.arv-doc-row{ display:flex; gap: 10px; flex-wrap: wrap; align-items:center; margin: 10px 0; }
.arv-doc-label{ color: var(--arv-text); }
.arv-doc-preview{ color: var(--arv-secondary); text-decoration: underline; cursor: pointer; font-weight: 700; }
.arv-doc-total{ margin-top: 12px; font-weight: 800; color: var(--arv-text); }

/* rende moderni checkbox / radio */
.arv-doc-radio, .arv-doc-check{ accent-color: var(--arv-primary); }

/* Modal preview */
body.arv-modal-open{ overflow:hidden; }
.arv-modal{ position:fixed; inset:0; z-index: 2147483647 !important; }
.arv-modal__backdrop{
  position:absolute; inset:0;
  background: rgba(2, 6, 23, .62);
  backdrop-filter: blur(6px);
}
.arv-modal__panel{
  position: relative;
  background: var(--arv-surface);
  color: var(--arv-text);
  max-width: 980px;
  margin: calc(var(--arv-sticky-offset, 0px) + 4vh) auto 4vh auto;
  border-radius: 16px;
  overflow: hidden;
  max-height: calc(92vh - var(--arv-sticky-offset, 0px));
  display:flex;
  flex-direction: column;
  border: 1px solid var(--arv-border);
  box-shadow: var(--arv-shadow);
}
.arv-modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--arv-border);
  background: rgba(100,116,139,.06);
}
.arv-modal__title{ margin: 0; font-size: 15px; color: var(--arv-text); }
.arv-modal__close{
  border: 1px solid var(--arv-border);
  background: var(--arv-surface);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  cursor:pointer;
  color: var(--arv-text);
}
.arv-modal__close:hover{ background: rgba(100,116,139,.10); }
.arv-modal__close:focus{ outline:none; box-shadow: var(--arv-focus); }
.arv-modal__body{ padding: 16px; overflow:auto; font-size: 16px; }

/* Doc 8 / Doc 9 – extra cards */
.arv-doc8-title,
.arv-doc9-title{
  text-align:center;
  font-weight: 900;
  margin: 12px 0;
  color: #fff;
  padding: 12px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47,107,63,.95), rgba(61,90,128,.92));
  box-shadow: var(--arv-shadow-2);
}

.arv-doc8-card,
.arv-doc9-card{
  background: var(--arv-surface);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--arv-border);
  box-shadow: var(--arv-shadow-2);
}

.arv-doc8-extra{ margin: 10px 0 18px; }
.arv-doc9-extra{ margin: 10px 0 18px; }

.arv-doc8-grid-4{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px){
  .arv-doc8-grid-4{ grid-template-columns: 1fr; }
}

.arv-doc9-grid-2wide{
  display:grid;
  grid-template-columns: 3fr 1fr;
  gap:14px;
}
.arv-doc9-grid-5{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap:14px;
}
@media (max-width: 1100px){
  .arv-doc9-grid-5{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px){
  .arv-doc9-grid-2wide{ grid-template-columns: 1fr; }
  .arv-doc9-grid-5{ grid-template-columns: 1fr; }
}

/* Dashboard “moderno” (usato se aggiungi le classi in sc_area_riservata) */

.arv-dashboard{
  max-width: 1100px;
  margin: 18px auto;
}

.arv-dashboard-head--no-title{
  justify-content: flex-end;
  margin-bottom: 12px;
}




.arv-dashboard-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.arv-dashboard-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px){
  .arv-dashboard-grid{ grid-template-columns: 1fr; }
}

.arv-tile{
  display:block;
  padding: 16px 16px;
  border-radius: 16px;
  border: 1px solid var(--arv-border);
  background: linear-gradient(180deg, rgba(100,116,139,.08), rgba(100,116,139,.02));
  text-decoration:none;
  color: var(--arv-text);
  box-shadow: var(--arv-shadow-2);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.arv-tile:hover{ transform: translateY(-1px); box-shadow: var(--arv-shadow); border-color: rgba(47,107,63,.35); }
.arv-tile__title{ font-weight: 900; margin-bottom: 6px; }
.arv-tile__desc{ color: var(--arv-muted); font-size: 13px; line-height: 1.45; }

/* Dashboard spacing */
.arv-dashboard{
  max-width: 1100px;
  margin: 18px auto;
}

/* Footer con Esci centrato */
.arv-dashboard-footer{
  margin-top: 16px;
  display:flex;
  justify-content:center;
}

/* Tile head con icona + titolo */
.arv-tile__head{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-bottom: 8px;
}

.arv-ico{
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  opacity: .9;
}

/* Niente underline su tile (anche se il tema forza underline sui link) */
.arv-tile,
.arv-tile:hover,
.arv-tile:focus{
  text-decoration: none !important;
}
.arv-tile *{
  text-decoration: none !important;
}

/* =========================
   Profile form (modern)
   ========================= */
.arv-profile-card{ max-width: 1100px; margin-left:auto; margin-right:auto; }

.arv-profile-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.arv-profile-title{
  display:flex;
  align-items:center;
  gap: 10px;
  margin: 0;
}

.arv-profile-divider{
  height: 1px;
  background: var(--arv-border-2);
  margin: 14px 0;
  border: 0;
}

.arv-required{ color: var(--arv-danger); font-weight: 900; }

.arv-checkrow{
  margin-top: 12px;
  display:flex;
  gap: 12px;
  align-items:flex-start;
  padding: 12px 12px;
  border: 1px solid var(--arv-border);
  border-radius: var(--arv-radius-sm);
  background: rgba(100,116,139,.06);
}

.arv-checkrow__box{
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--arv-primary);
  flex: 0 0 auto;
}

.arv-checkrow__label{ cursor:pointer; }

.arv-checkrow__title{
  font-weight: 900;
  color: var(--arv-text);
  margin-bottom: 2px;
}

.arv-checkrow__desc{
  color: var(--arv-muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Select con freccia coerente */
.arv-profile-form select.arv-input{
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(100,116,139,.9) 50%),
    linear-gradient(135deg, rgba(100,116,139,.9) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

/* =========================
   Annotatore – Cerca & Lista utenti (modern)
   ========================= */
.arv-ann-search .arv-form{ margin-top: 12px; }

.arv-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.arv-toolbar--tight{ margin-bottom: 10px; }

.arv-toolbar__left,
.arv-toolbar__right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}
.arv-toolbar__title{
  font-weight: 900;
  font-size: 16px;
  color: var(--arv-text);
}

.arv-chip{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--arv-border);
  background: rgba(100,116,139,.06);
  color: var(--arv-text);
  font-size: 12px;
  font-weight: 700;
}
.arv-chip strong{ font-weight: 900; }

.arv-searchrow{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
}
.arv-searchrow__input{
  position: relative;
  flex: 1 1 320px;
}
.arv-searchrow__input .arv-ico{
  position:absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--arv-muted);
  opacity: .95;
}
.arv-searchrow__input input.arv-input{
  padding-left: 40px;
}

.arv-platform-user-search .arv-searchrow,
.arv-platform-annotator-search .arv-searchrow{
  margin-bottom: 18px;
}

.arv-empty{
  padding: 14px;
  border: 1px dashed var(--arv-border);
  border-radius: var(--arv-radius);
  background: rgba(100,116,139,.04);
}
.arv-empty__title{ font-weight: 900; margin-bottom: 4px; color: var(--arv-text); }
.arv-empty__desc{ color: var(--arv-muted); font-size: 13px; line-height: 1.45; }

/* Riga utente */
.arv-usercell{
  display:flex;
  align-items:center;
  gap: 10px;
}
.arv-avatar{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(47,107,63,.12);
  color: var(--arv-primary);
  font-weight: 900;
  flex: 0 0 auto;
}
.arv-username{
  font-weight: 900;
  line-height: 1.2;
  color: var(--arv-text);
}
.arv-usersub{
  margin-top: 3px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Badge */
.arv-badge{
  display:inline-flex;
  align-items:center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--arv-border);
  background: rgba(61,90,128,.10);
  color: var(--arv-secondary);
  font-size: 11px;
  font-weight: 800;
}

/* Azioni come bottoni-icone */
.arv-row-actions{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.arv-iconbtn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--arv-border);
  background: var(--arv-surface-2);
  color: var(--arv-text);
  font-weight: 800;
  text-decoration: none !important;
  box-shadow: var(--arv-shadow-2);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.arv-iconbtn:hover{
  transform: translateY(-1px);
  box-shadow: var(--arv-shadow);
  border-color: rgba(47,107,63,.35);
  background: rgba(47,107,63,.06);
}
.arv-iconbtn:active{ transform: translateY(0); opacity: .92; }
.arv-iconbtn svg{ width: 16px; height: 16px; opacity: .9; }
.arv-iconbtn--primary{
  background: rgba(47,107,63,.10);
  color: var(--arv-primary);
}

/* Tabella utenti: modalità "card" su mobile */
.arv-table-users td{ vertical-align: middle; }

@media (max-width: 900px){
  .arv-table-users thead{ display:none; }
  .arv-table-users,
  .arv-table-users tbody,
  .arv-table-users tr,
  .arv-table-users td{
    display:block;
    width:100%;
  }
  .arv-table-users{
    border:none;
    background: transparent;
    box-shadow: none;
  }
  .arv-table-users tr{
    margin: 0 0 12px 0;
    border: 1px solid var(--arv-border);
    border-radius: var(--arv-radius);
    overflow: hidden;
    background: var(--arv-surface);
    box-shadow: var(--arv-shadow-2);
  }
  .arv-table-users td{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--arv-border-2);
    padding: 12px;
  }
  .arv-table-users td::before{
    content: attr(data-label);
    font-weight: 800;
    color: var(--arv-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .03em;
    flex: 0 0 auto;
    padding-top: 2px;
  }
  .arv-table-users td:last-child{ border-bottom: none; }
}

/* Paginazione */
.arv-pagination{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content:center;
}
.arv-pagination a,
.arv-pagination span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--arv-border);
  background: var(--arv-surface);
  color: var(--arv-text);
  font-weight: 800;
  text-decoration: none !important;
  box-shadow: var(--arv-shadow-2);
}
.arv-pagination a:hover{
  border-color: rgba(47,107,63,.35);
  background: rgba(47,107,63,.06);
}
.arv-pagination .arv-current{
  background: rgba(47,107,63,.12);
  border-color: rgba(47,107,63,.35);
  color: var(--arv-primary);
}
.arv-pagination .arv-disabled{ opacity: .45; }
.arv-pagination .arv-dots{
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

/* =========================
   Annotatore – Nuovo utente (modern)
   ========================= */
.arv-ann-newuser{ max-width: 1100px; margin-left:auto; margin-right:auto; }

.arv-chip--muted{ background: rgba(100,116,139,.06); }

.arv-section{ margin: 8px 0 10px; }
.arv-section__title{ font-weight: 900; color: var(--arv-text); font-size: 14px; }
.arv-section__desc{ color: var(--arv-muted); font-size: 13px; line-height: 1.45; margin-top: 2px; }

.arv-divider{ height: 1px; background: var(--arv-border-2); margin: 14px 0; }

/* Select con freccia coerente (solo form nuovo utente) */
.arv-ann-newuser-form select.arv-input{
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(100,116,139,.9) 50%),
    linear-gradient(135deg, rgba(100,116,139,.9) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

/* Checkbox privacy più compatta */
.arv-checkrow--compact{
  background: rgba(100,116,139,.04);
}

@media (max-width: 900px){
  .arv-ann-newuser .arv-actions{ justify-content: stretch; }
  .arv-ann-newuser .arv-actions .arv-btn,
  .arv-ann-newuser .arv-actions a.arv-btn{ width: 100%; }
}

.arv-logout-center{
  display:flex;
  justify-content:center;
  margin: 18px auto;
  max-width: 1100px;
}

.arv-logout-center a{
  text-decoration: none !important;
}
.page-id-541 .container {
    max-width: 1400px !important;
}
.page-id-541 .arv-box {
    max-width: unset !important;
}
