/* ====== FINTECH THEME FOR YITH AFFILIATES DASHBOARD (FULL) ====== */
:root {
  --bg: #f6f8fb;
  --card: #fff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-700: #1e40af;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(2, 6, 23, 0.08);
  --shadow-sm: 0 2px 10px rgba(2, 6, 23, 0.06);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
}

/* Scope */
.yith-wcaf-dashboard-navigation {
  padding: 0 !important;
}

.affiliate-stats .woocommerce-Price-amount,
.affiliate-stats .woocommerce-Price-currencySymbol {
  font-weight: 700;
}

.yith-wcaf.yith-wcaf-dashboard {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
}
.woocommerce-Price-amount.amount {
  font-variant-numeric: tabular-nums;
}

/* ---------- NAV ---------- */
.yith-wcaf-dashboard-navigation {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0 0 18px;
}
.yith-wcaf-dashboard-navigation-item a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}
.yith-wcaf-dashboard-navigation-item a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.yith-wcaf-dashboard-navigation-item.is-active a {
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  border-color: transparent;
}

/* ---------- STATS ---------- */
.affiliate-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.stat-item .stat-label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-item .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.stat-item.large .stat-value {
  font-size: 1.4rem;
}

/* ---------- BUTTONS ---------- */
.yith-wcaf a.button,
.yith-wcaf .button,
#withdraw_modal_opener {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff !important;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.yith-wcaf a.button:hover,
.yith-wcaf .button:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.32);
}
.yith-wcaf a.button:focus,
.yith-wcaf .button:focus {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

/* Fix pulsante 'Richiedi pagamento' nel box saldo */
#withdraw_modal_opener_wrapper {
  display: block;
  margin-top: 12px;
}
#withdraw_modal_opener {
  display: inline-block;
  width: 100%;
  text-align: center;
}

/* ---------- SECTION TITLES ---------- */
.dashboard-title h3 {
  font-size: 1.1rem;
  letter-spacing: 0.2px;
  margin: 6px 0 10px;
  color: var(--text);
}

/* ---------- TABLES ---------- */
.yith-wcaf-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.yith-wcaf-table thead th {
  background: #f1f5f9;
  color: #0b1220;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.yith-wcaf-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.yith-wcaf-table tbody tr:last-child td {
  border-bottom: 0;
}
.yith-wcaf-table tbody tr:hover {
  background: #f8fafc;
}
.yith-wcaf-table-bottom-bar {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 14px 14px;
}

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.status-badge.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.status-badge.paid {
  background: rgba(22, 163, 74, 0.12);
  color: #065f46;
  border: 1px solid rgba(22, 163, 74, 0.35);
}

/* ---------- MODAL (YITH usa .open) ---------- */

/* Nascondi sempre il contenuto del withdraw */
#withdraw_modal {
  display: none !important;
}

/* Mostra solo quando è DENTRO la modal YITH aperta (classe .open) */
.yith-wcaf-modal.open #withdraw_modal {
  display: block !important;
}

.yith-wcaf-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.yith-wcaf-modal.open {
  opacity: 1;
  visibility: visible;
}

/* Nascondo il titolo esterno (teniamo solo la card) */
.yith-wcaf-modal .title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Card */
.yith-wcaf-modal .content {
  width: 100%;
  max-width: 680px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.25);
  animation: modal-pop 0.18s ease-out;
}

/* Header saldo nel modal */
#withdraw_modal .balance-recap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
#withdraw_modal h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}
#withdraw_modal .affiliate-balance .amount {
  font-weight: 800;
  font-size: 1.05rem;
}

/* Campo importo */
#withdraw_modal .withdraw-amount .form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.06) inset;
}
#withdraw_modal .withdraw-amount .woocommerce-Price-currencySymbol {
  font-weight: 800;
  color: var(--primary-700);
}
#withdraw_modal input[type='number'].amount {
  appearance: textfield;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
  padding: 4px 0;
}
#withdraw_modal .withdraw-amount .form-row:focus-within {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Note */
#withdraw_modal small.withdraw-notes {
  display: block;
  color: var(--muted);
  margin: 10px 2px 14px;
  line-height: 1.45;
}

/* Submit full width */
#withdraw_modal .button.submit {
  width: 100%;
}

/* Close floating */
.yith-wcaf-modal .close-button {
  position: fixed;
  top: 18px;
  right: 22px;
  background: #0f172a;
  color: #fff !important;
  width: 36px;
  height: 36px;
  line-height: 36px;
  border-radius: 999px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.25);
  font-size: 20px;
  transition: transform 0.12s ease;
}
.yith-wcaf-modal .close-button:hover {
  transform: translateY(-1px);
}

/* Animazione modal */
@keyframes modal-pop {
  from {
    transform: translateY(8px) scale(0.98);
    opacity: 0.7;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ---------- LINKS ---------- */
.yith-wcaf a {
  color: var(--primary);
}
.yith-wcaf a:hover {
  color: var(--primary-600);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .affiliate-stats {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .yith-wcaf.yith-wcaf-dashboard {
    padding: 16px;
  }
  .yith-wcaf-dashboard-navigation {
    gap: 8px;
  }
  .yith-wcaf-dashboard-navigation-item a {
    padding: 8px 12px;
    border-radius: 10px;
  }
  .yith-wcaf-table thead {
    display: none;
  }
  .yith-wcaf-table tr {
    display: block;
  }
  .yith-wcaf-table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .yith-wcaf-table td:before {
    content: attr(data-title);
    color: var(--muted);
    font-weight: 600;
  }
  .yith-wcaf-modal {
    padding: 12px;
  }
  .yith-wcaf-modal .content {
    max-width: calc(100% - 8px);
    border-radius: 16px;
    padding: 18px;
  }
}

/* ====== SETTINGS (YITH Affiliates) ====== */
.yith-wcaf-dashboard-settings .dashboard-title h3 {
  font-size: 1.25rem;
  margin: 0 0 12px;
  color: var(--text);
}

.yith-wcaf-dashboard-settings .affiliate-settings-box {
  display: block;
  gap: 16px;
}

.yith-wcaf-dashboard-settings .settings-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* Titolo sezione (es. Bonifico bancario) */
.yith-wcaf-dashboard-settings .settings-box > h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text);
}

/* Campi input */
.yith-wcaf-dashboard-settings .form-row {
  margin: 0 0 12px;
}
.yith-wcaf-dashboard-settings label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 6px;
}
.yith-wcaf-dashboard-settings .woocommerce-input-wrapper input.input-text {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
}
.yith-wcaf-dashboard-settings
  .woocommerce-input-wrapper
  input.input-text:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Toggle notifiche (checkbox → switch) */
.yith-wcaf-dashboard-settings .toggle-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.yith-wcaf-dashboard-settings .toggle-right label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
}
.yith-wcaf-dashboard-settings .toggle-right small {
  color: var(--muted);
  margin-left: 44px; /* allinea col toggle */
}

/* Switch */
.yith-wcaf-dashboard-settings input.yith-wcaf-toggle {
  appearance: none;
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.yith-wcaf-dashboard-settings .toggle {
  position: relative;
  width: 42px;
  height: 26px;
  flex: 0 0 42px;
  background: #e5e7eb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.yith-wcaf-dashboard-settings .toggle:before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(2, 6, 23, 0.2);
  transition: transform 0.15s ease;
}
.yith-wcaf-dashboard-settings input.yith-wcaf-toggle:checked + .toggle {
  background: var(--primary);
  border-color: var(--primary);
}
.yith-wcaf-dashboard-settings input.yith-wcaf-toggle:checked + .toggle:before {
  transform: translateX(16px);
}

/* Pulsante Salva */
.yith-wcaf-dashboard-settings input[type='submit'][name='settings_submit'] {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.yith-wcaf-dashboard-settings
  input[type='submit'][name='settings_submit']:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.32);
}

/* Spaziatura generale */
.yith-wcaf-dashboard-settings form {
  max-width: 900px;
}
.yith-wcaf-dashboard-settings .personal-info {
  margin-bottom: 0;
}

/* Mobile */
@media (max-width: 640px) {
  .yith-wcaf-dashboard-settings .settings-box {
    padding: 16px;
    border-radius: 12px;
  }
  .yith-wcaf-dashboard-settings .toggle-right small {
    margin-left: 0;
  }
}

/* ====== GENERA LINK (YITH Affiliates) ====== */
.yith-wcaf-dashboard-generate-link .dashboard-title h3 {
  font-size: 1.25rem;
  margin: 0 0 14px;
  color: var(--text);
}

/* Layout 2 colonne */
.yith-wcaf-dashboard-generate-link .link-generator-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Card */
.yith-wcaf-dashboard-generate-link .affiliate-info,
.yith-wcaf-dashboard-generate-link .link-generator {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.yith-wcaf-dashboard-generate-link h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text);
}
.yith-wcaf-dashboard-generate-link .regular-text {
  font-weight: 800;
  margin-left: 6px;
}

/* Campi + label */
.yith-wcaf-dashboard-generate-link .form-row {
  margin: 0 0 12px;
}
.yith-wcaf-dashboard-generate-link label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 6px;
}
.yith-wcaf-dashboard-generate-link input[type='url'],
.yith-wcaf-dashboard-generate-link input[type='text'] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
  font-variant-numeric: tabular-nums;
}
.yith-wcaf-dashboard-generate-link input:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Campo con bottone "Copia URL" */
.yith-wcaf-dashboard-generate-link .copy-field-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}
.yith-wcaf-dashboard-generate-link .copy-field-wrapper .copy-target {
  flex: 1;
}
.yith-wcaf-dashboard-generate-link .copy-field-wrapper .copy-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.yith-wcaf-dashboard-generate-link .copy-field-wrapper .copy-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.3);
}

/* Testi di aiuto */
.yith-wcaf-dashboard-generate-link small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 6px;
}

/* Icone social */
.yith-wcaf-dashboard-generate-link .yith-wcaf-share {
  margin-top: 14px;
}
.yith-wcaf-dashboard-generate-link .yith-wcaf-share-title {
  font-size: 0.95rem;
  margin: 0 0 8px;
  color: var(--text);
}
.yith-wcaf-dashboard-generate-link .yith-wcaf-share ul {
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.yith-wcaf-dashboard-generate-link .yith-wcaf-share li {
  list-style: none;
}
.yith-wcaf-dashboard-generate-link .yith-wcaf-share a[class^='icon-yith-'] {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  text-decoration: none;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background 0.2s ease;
  font-size: 20px; /* le icone YITH sono font-icon */
}
.yith-wcaf-dashboard-generate-link
  .yith-wcaf-share
  a[class^='icon-yith-']:hover {
  transform: translateY(-1px);
  background: #e8eefc;
}

/* Responsive */
@media (max-width: 900px) {
  .yith-wcaf-dashboard-generate-link .link-generator-box {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .yith-wcaf-dashboard-generate-link .affiliate-info,
  .yith-wcaf-dashboard-generate-link .link-generator {
    padding: 16px;
    border-radius: 12px;
  }
}

/* ====== PAGAMENTI → FILTRI ====== */
.yith-wcaf-dashboard-payments .yith-wcaf-table-top-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* Layout filtri */
.yith-wcaf-dashboard-payments .table-filters {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr auto;
  gap: 10px;
  align-items: center;
}

/* Select2 (stato) */
.yith-wcaf-dashboard-payments .select2-container {
  width: 100% !important;
}
.yith-wcaf-dashboard-payments .select2-selection--single {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
}
.yith-wcaf-dashboard-payments
  .select2-selection--single
  .select2-selection__rendered {
  line-height: 44px;
  padding: 0 14px;
  color: var(--text);
}
.yith-wcaf-dashboard-payments
  .select2-selection--single
  .select2-selection__arrow {
  height: 44px;
  right: 10px;
}
.yith-wcaf-dashboard-payments
  .select2-container--open
  .select2-selection--single {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Datepicker */
.yith-wcaf-dashboard-payments .yith-wcaf-enhanced-date-picker {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 12px;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
  outline: 0;
}
.yith-wcaf-dashboard-payments .yith-wcaf-enhanced-date-picker:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Pulsante Filtra */
.yith-wcaf-dashboard-payments .apply-filters {
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.yith-wcaf-dashboard-payments .apply-filters:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.3);
}

/* Opzioni: per_page */
.yith-wcaf-dashboard-payments .table-options {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.yith-wcaf-dashboard-payments .table-options .per-page {
  color: var(--muted);
  font-size: 0.9rem;
}
.yith-wcaf-dashboard-payments .quantity-input {
  width: 80px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  outline: 0;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
}
.yith-wcaf-dashboard-payments .quantity-input:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Responsive */
@media (max-width: 900px) {
  .yith-wcaf-dashboard-payments .table-filters {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .yith-wcaf-dashboard-payments .table-filters {
    grid-template-columns: 1fr;
  }
  .yith-wcaf-dashboard-payments .table-options {
    justify-content: space-between;
  }
}

/* =========================================================
   DATEPICKER – YITH / jQuery UI  (fintech full restyle)
   Scope limitato: solo sui datepicker YITH
   ========================================================= */
#ui-datepicker-div.yith-wcaf-datepicker,
#ui-datepicker-div.yith-plugin-fw-datepicker-div {
  /* layer & box */
  position: absolute;
  z-index: 99999 !important;
  width: 320px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  box-shadow: 0 32px 90px rgba(2, 6, 23, 0.25);
  padding: 8px 8px 12px;
  font-family: var(
    --font,
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial
  );
  color: var(--text, #0f172a);
  margin-top: 6px; /* distacco dall’input */
  animation: dp-fade 0.14s ease-out;
}

/* ------- Header (mese/anno + frecce) ------- */
#ui-datepicker-div.yith-wcaf-datepicker .ui-datepicker-header,
#ui-datepicker-div.yith-plugin-fw-datepicker-div .ui-datepicker-header {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 6px 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ui-datepicker-div .ui-datepicker-title {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}
#ui-datepicker-div .ui-datepicker-prev,
#ui-datepicker-div .ui-datepicker-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.06);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#ui-datepicker-div .ui-datepicker-prev {
  left: 6px;
}
#ui-datepicker-div .ui-datepicker-next {
  right: 6px;
}
#ui-datepicker-div .ui-datepicker-prev:hover,
#ui-datepicker-div .ui-datepicker-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.16);
  background: #f9fafb;
}
/* icone frecce (sostituisce gli sprite jQuery UI) */
#ui-datepicker-div .ui-icon {
  text-indent: -9999px;
  overflow: hidden;
}
#ui-datepicker-div .ui-datepicker-prev:after,
#ui-datepicker-div .ui-datepicker-next:after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text, #0f172a);
  border-bottom: 2px solid var(--text, #0f172a);
}
#ui-datepicker-div .ui-datepicker-prev:after {
  transform: rotate(135deg);
}
#ui-datepicker-div .ui-datepicker-next:after {
  transform: rotate(-45deg);
}

/* ------- Tabella calendario ------- */
#ui-datepicker-div .ui-datepicker-calendar {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px; /* spazio “chip” tra giorni */
  padding: 0 6px;
}
#ui-datepicker-div .ui-datepicker-calendar thead th {
  padding: 0;
}
#ui-datepicker-div .ui-datepicker-calendar thead th span {
  display: block;
  text-align: center;
  color: var(--muted, #6b7280);
  font-weight: 700;
  font-size: 0.8rem;
}

/* celle */
#ui-datepicker-div .ui-datepicker-calendar td {
  width: calc((100% - 36px) / 7);
  padding: 0;
}
#ui-datepicker-div .ui-datepicker-calendar a.ui-state-default,
#ui-datepicker-div .ui-datepicker-calendar span.ui-state-default {
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  color: var(--text, #0f172a);
  background: #fff;
  border: 1px solid #e9edf5;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.1s ease;
}
#ui-datepicker-div .ui-datepicker-calendar a.ui-state-default:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  transform: translateY(-1px);
}

/* oggi (highlight sobrio con puntino) */
#ui-datepicker-div .ui-datepicker-today a.ui-state-highlight {
  position: relative;
  font-weight: 800;
  background: #f4f6ff;
  border-color: #dbe2ff;
}
#ui-datepicker-div .ui-datepicker-today a.ui-state-highlight::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #1e40af;
}

/* selezionato */
#ui-datepicker-div .ui-state-active {
  background: linear-gradient(
    180deg,
    var(--primary, #2563eb),
    var(--primary-600, #1d4ed8)
  ) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

/* weekend leggermente distinti */
#ui-datepicker-div .ui-datepicker-week-end a.ui-state-default {
  background: #fbfdff;
}

/* giorni disabilitati o di altri mesi */
#ui-datepicker-div td.ui-datepicker-other-month a,
#ui-datepicker-div td.ui-state-disabled span {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #9ca3af;
  cursor: default;
}

/* ------- Animazione ------- */
@keyframes dp-fade {
  from {
    transform: translateY(6px) scale(0.992);
    opacity: 0.7;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ------- Accessibilità touch / piccoli schermi ------- */
@media (max-width: 420px) {
  #ui-datepicker-div.yith-wcaf-datepicker,
  #ui-datepicker-div.yith-plugin-fw-datepicker-div {
    width: 300px;
  }
  #ui-datepicker-div .ui-datepicker-calendar {
    border-spacing: 5px;
  }
}

/* ------- (Opzionale) Stile per possibili range custom -------
   Se in futuro userai un datepicker con range che aggiunge
   classi .is-range, .is-start, .is-end, avrai già i colori. */
#ui-datepicker-div .is-range {
  background: #eef2ff !important;
  border-color: #c7d2fe !important;
  color: #1e3a8a !important;
}
#ui-datepicker-div .is-start,
#ui-datepicker-div .is-end {
  background: linear-gradient(
    180deg,
    var(--primary, #2563eb),
    var(--primary-600, #1d4ed8)
  ) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* ====== VISITE/CLICKS → FILTRI ====== */
.yith-wcaf-dashboard-clicks .yith-wcaf-table-top-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* Layout filtri */
.yith-wcaf-dashboard-clicks .table-filters {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr auto; /* stato, da, a, bottone */
  gap: 10px;
  align-items: center;
}

/* Select2 (stato) */
.yith-wcaf-dashboard-clicks .select2-container {
  width: 100% !important;
}
.yith-wcaf-dashboard-clicks .select2-selection--single {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
}
.yith-wcaf-dashboard-clicks .select2-selection__rendered {
  line-height: 44px;
  padding: 0 14px;
  color: var(--text);
}
.yith-wcaf-dashboard-clicks .select2-selection__arrow {
  height: 44px;
  right: 10px;
}
.yith-wcaf-dashboard-clicks
  .select2-container--open
  .select2-selection--single {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Datepicker inputs */
.yith-wcaf-dashboard-clicks .yith-wcaf-enhanced-date-picker {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 12px;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
  outline: 0;
}
.yith-wcaf-dashboard-clicks .yith-wcaf-enhanced-date-picker:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Pulsante Filtra */
.yith-wcaf-dashboard-clicks .apply-filters {
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.yith-wcaf-dashboard-clicks .apply-filters:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.3);
}

/* Opzioni: per_page */
.yith-wcaf-dashboard-clicks .table-options {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.yith-wcaf-dashboard-clicks .table-options .per-page {
  color: var(--muted);
  font-size: 0.9rem;
}
.yith-wcaf-dashboard-clicks .quantity-input {
  width: 80px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  outline: 0;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
}
.yith-wcaf-dashboard-clicks .quantity-input:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Responsive */
@media (max-width: 900px) {
  .yith-wcaf-dashboard-clicks .table-filters {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .yith-wcaf-dashboard-clicks .table-filters {
    grid-template-columns: 1fr;
  }
  .yith-wcaf-dashboard-clicks .table-options {
    justify-content: space-between;
  }
}

/* ====== COMMISSIONI → FILTRI ====== */
.yith-wcaf-dashboard-commissions .yith-wcaf-table-top-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* Layout filtri */
.yith-wcaf-dashboard-commissions .table-filters {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.8fr 0.8fr auto;
  /* stato, prodotto, da, a, bottone */
  gap: 10px;
  align-items: center;
}

/* Select2 (stato) */
.yith-wcaf-dashboard-commissions .select2-container {
  width: 100% !important;
}
.yith-wcaf-dashboard-commissions .select2-selection--single {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
}
.yith-wcaf-dashboard-commissions .select2-selection__rendered {
  line-height: 44px;
  padding: 0 14px;
  color: var(--text);
}
.yith-wcaf-dashboard-commissions .select2-selection__arrow {
  height: 44px;
  right: 10px;
}
.yith-wcaf-dashboard-commissions
  .select2-container--open
  .select2-selection--single {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Product search (WooCommerce) */
.yith-wcaf-dashboard-commissions .wc-product-search {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 12px;
  width: 100%;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
}
.yith-wcaf-dashboard-commissions .wc-product-search:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Datepicker inputs */
.yith-wcaf-dashboard-commissions .yith-wcaf-enhanced-date-picker {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 12px;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
  outline: 0;
}
.yith-wcaf-dashboard-commissions .yith-wcaf-enhanced-date-picker:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Pulsante Filtra */
.yith-wcaf-dashboard-commissions .apply-filters {
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.yith-wcaf-dashboard-commissions .apply-filters:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.3);
}

/* Opzioni: per_page */
.yith-wcaf-dashboard-commissions .table-options {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.yith-wcaf-dashboard-commissions .table-options .per-page {
  color: var(--muted);
  font-size: 0.9rem;
}
.yith-wcaf-dashboard-commissions .quantity-input {
  width: 80px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  outline: 0;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.04) inset;
}
.yith-wcaf-dashboard-commissions .quantity-input:focus {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Responsive */
@media (max-width: 1100px) {
  .yith-wcaf-dashboard-commissions .table-filters {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .yith-wcaf-dashboard-commissions .table-filters {
    grid-template-columns: 1fr;
  }
  .yith-wcaf-dashboard-commissions .table-options {
    justify-content: space-between;
  }
}
