/* ===== SEARCH (catalogo + prodotti) ===== */
.dcv-b2b form.b2b-search-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  margin: 18px 0 22px;
}

.dcv-b2b form.b2b-search-form input[type="text"],
.dcv-b2b form.b2b-search-form input[type="search"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
}

.dcv-b2b form.b2b-search-form button,
.dcv-b2b form.b2b-search-form input[type="submit"] {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 30px rgba(14,165,233,.35);
  white-space: nowrap;
}

/* ===== TABELLA ===== */
.dcv-b2b table {
  margin-top: 8px; /* micro-rifinitura spacing */
}

/* ===== NOME PRODOTTO ===== */
.dcv-b2b .b2b-name {
  font-weight: 700;
}

/* ===== COLONNA PREZZO ===== */
.dcv-b2b .b2b-price-cell {
  white-space: nowrap;
  font-weight: 700;
  text-align: right;
}

/* ===== INPUT QUANTITÀ ===== */
.dcv-b2b .b2b-qty {
  height: 40px; /* armonizza con bottone */
}

/* ===== HELPERS ===== */
.dcv-b2b .b2b-mt-18 {
  margin-top: 18px;
}

.dcv-b2b .b2b-error {
  color: #c62828;
  font-weight: 600;
}


.dcv-b2b-home-promos{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin:10px 0 18px;
}

.dcv-b2b-home-promo-row{
  padding-bottom:12px;
  border-bottom:1px solid #e7edf3;
}

.dcv-b2b-home-promo-row:last-child{
  border-bottom:0;
  padding-bottom:0;
}

.dcv-b2b-home-promo-name{
  font-weight:700;
  color:#162033;
  margin-bottom:6px;
  line-height:1.3;
}

.dcv-b2b-home-promo-prices{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
}

.dcv-b2b-home-promo-badge{
  display:inline-block;
  background:#e74c3c;
  color:#fff;
  font-size:12px;
  font-weight:700;
  line-height:1;
  padding:4px 8px;
  border-radius:6px;
}

.dcv-b2b-home-promo-old{
  color:#7b8794;
  text-decoration:line-through;
  font-size:15px;
  line-height:1.2;
}

.dcv-b2b-home-promo-new{
  color:#e53935;
  font-size:28px;
  font-weight:800;
  line-height:1.05;
}

/* =========================================================
   AREA AGENTE - LAYOUT CONDIVISO
   ========================================================= */

.dcv-b2b .b2b-admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

.dcv-b2b .b2b-admin-sidebar {
  background: #ffffff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.dcv-b2b .b2b-admin-sidebar h3 {
  margin: 0 0 18px;
  font-size: 20px;
}

.dcv-b2b .b2b-admin-sidebar a {
  display: block;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  transition: all 0.2s ease;
}

.dcv-b2b .b2b-admin-sidebar a:hover,
.dcv-b2b .b2b-admin-sidebar a.active {
  background: #2fb8ee;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(47, 184, 238, 0.28);
}

.dcv-b2b .b2b-admin-content {
  background: #ffffff;
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.dcv-b2b .b2b-admin-content h1 {
  margin-top: 0;
  font-size: 34px;
}

.dcv-b2b .b2b-admin-content > p {
  margin-bottom: 28px;
  color: #475569;
  font-size: 17px;
}

/* =========================================================
   DASHBOARD AGENTE - KPI
   ========================================================= */

.dcv-b2b-agent-dashboard .b2b-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
}

.dcv-b2b-agent-dashboard .b2b-kpi-card {
  background: linear-gradient(180deg, #f8fbff 0%, #edf8ff 100%);
  border: 1px solid rgba(47, 184, 238, 0.18);
  border-radius: 22px;
  padding: 22px;
  min-height: 120px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.dcv-b2b-agent-dashboard .b2b-kpi-card span {
  display: block;
  margin-bottom: 12px;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.dcv-b2b-agent-dashboard .b2b-kpi-card strong {
  display: block;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.1;
}

/* =========================================================
   NUOVO CLIENTE
   ========================================================= */

.dcv-b2b-agent-new-customer .b2b-form-section {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

.dcv-b2b-agent-new-customer .b2b-form-section h2 {
  margin: 0 0 20px;
  font-size: 22px;
}

.dcv-b2b-agent-new-customer .b2b-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dcv-b2b-agent-new-customer label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.dcv-b2b-agent-new-customer input,
.dcv-b2b-agent-new-customer select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  background: #fff;
}

.dcv-b2b-agent-new-customer .b2b-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.dcv-b2b-agent-new-customer .button-primary {
  background: #2fb8ee;
  border: none;
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
}

.dcv-b2b-agent-new-customer .b2b-agent-notice {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.dcv-b2b-agent-new-customer .success {
  background: #dcfce7;
  color: #166534;
}

.dcv-b2b-agent-new-customer .error {
  background: #fee2e2;
  color: #991b1b;
}

/* =========================================================
   RESPONSIVE AREA AGENTE
   ========================================================= */

@media (max-width: 900px) {
  .dcv-b2b .b2b-admin-layout {
    grid-template-columns: 1fr;
  }

  .dcv-b2b-agent-dashboard .b2b-kpi-grid,
  .dcv-b2b-agent-new-customer .b2b-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   CREA ORDINE AGENTE
   ========================================================= */

.dcv-b2b .b2b-card {
    background: #ffffff;
    border-radius: 26px;
    padding: 30px;
    margin-bottom: 28px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.dcv-b2b .b2b-card h2,
.dcv-b2b .b2b-card h3 {
    margin-top: 0;
    color: #0f172a;
}

/* =========================================================
   TABELLE
   ========================================================= */

.dcv-b2b table.widefat {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.dcv-b2b table.widefat th {
    background: #eaf7ff;
    color: #475569;
    font-weight: 800;
    padding: 16px;
    text-align: left;
}

.dcv-b2b table.widefat td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    color: #0f172a;
    vertical-align: middle;
}

.dcv-b2b table.widefat tr:last-child td {
    border-bottom: none;
}

.dcv-b2b table.widefat tr:nth-child(even) td {
    background: #f8fbff;
}

/* =========================================================
   QUANTITÀ
   ========================================================= */

.dcv-b2b .b2b-agent-qty {
    width: 82px !important;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0 10px;
    font-weight: 700;
    text-align: center;
}

/* =========================================================
   PULSANTI
   ========================================================= */

.dcv-b2b .button,
.dcv-b2b button.button,
.dcv-b2b .b2b-agent-add {
    border: none;
    border-radius: 12px;
    padding: 9px 16px;
    background: #2fb8ee;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
}

.dcv-b2b .button:hover,
.dcv-b2b button.button:hover,
.dcv-b2b .b2b-agent-add:hover {
    background: #169dd1;
    transform: translateY(-1px);
}

/* =========================================================
   RIMUOVI
   ========================================================= */

.dcv-b2b .b2b-agent-remove {
    border: none;
    border-radius: 12px;
    padding: 9px 16px;
    background: #ef4444;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s ease;
}

.dcv-b2b .b2b-agent-remove:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* =========================================================
   CREA ORDINE
   ========================================================= */

.dcv-b2b #b2b-agent-create-order {
    background: #2fb8ee;
    padding: 13px 24px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 800;
}

.dcv-b2b #b2b-agent-create-order:hover {
    background: #169dd1;
}

.dcv-b2b #b2b-agent-create-order:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* =========================================================
   TOTALE
   ========================================================= */

.dcv-b2b #b2b-agent-total {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

/* =========================================================
   SU RICHIESTA
   ========================================================= */

.dcv-b2b .b2b-su-richiesta,
.dcv-b2b .b2b-price-request {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-weight: 800;
}


.b2b-order-status{
    display:inline-block;
    padding:6px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.b2b-order-status-processing{
    background:#dbeafe;
    color:#1d4ed8;
}

.b2b-order-status-completed{
    background:#dcfce7;
    color:#166534;
}

.b2b-order-status-on-hold{
    background:#fef3c7;
    color:#92400e;
}

.b2b-order-status-pending{
    background:#fee2e2;
    color:#991b1b;
}

.b2b-agent-selected{
    display:flex;
    justify-content:space-between;
    align-items:center;

    margin:0 0 20px;
    padding:12px 16px;

    background:#f7fbff;
    border:1px solid #d6ebf7;
    border-radius:12px;
}

.b2b-agent-selected__info{
    font-size:16px;
}

.b2b-agent-selected .button{
    margin:0;
}