/* Tabs */
.b2b-tabs { display:flex; gap:0; border-bottom:2px solid var(--pl-border); margin-bottom:24px; }
.b2b-tab { padding:12px 20px; font-size:13px; font-weight:700; color:#64748b; cursor:pointer; border:none; background:none; border-bottom:3px solid transparent; margin-bottom:-2px; transition:all 0.15s; display:flex; align-items:center; gap:6px; }
.b2b-tab:hover { color:var(--pl-primary); }
.b2b-tab.active { color:var(--pl-primary); border-bottom-color:var(--pl-primary); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

/* Cards & Table */
.b2b-card { background:#fff; border-radius:var(--pl-radius); border:1px solid var(--pl-border); box-shadow:var(--pl-shadow); overflow:hidden; margin-bottom:20px; }
.b2b-card-header { padding:16px 20px; border-bottom:1px solid var(--pl-border); display:flex; align-items:center; justify-content:space-between; font-weight:700; font-size:15px; flex-wrap:wrap; gap:8px; }
.b2b-card-body { padding:20px; }
.b2b-table { width:100%; border-collapse:collapse; }
.b2b-table th { padding:8px 14px; font-size:11px; text-transform:uppercase; letter-spacing:0.5px; font-weight:700; color:var(--pl-text-muted); background:#f8fafc; border-bottom:1px solid var(--pl-border); text-align:left; white-space:nowrap; }
.b2b-table td { padding:10px 14px; font-size:13px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.b2b-table tbody tr:hover { background:#f8fafc; }

/* Tableau Mes Devis — colonnes bien proportionnées */
.devis-table { table-layout:fixed; }
.devis-table th:nth-child(1), .devis-table td:nth-child(1) { width:14%; }
.devis-table th:nth-child(2), .devis-table td:nth-child(2) { width:10%; }
.devis-table th:nth-child(3), .devis-table td:nth-child(3) { width:16%; }
.devis-table th:nth-child(4), .devis-table td:nth-child(4) { width:10%; text-align:center; }
.devis-table th:nth-child(5), .devis-table td:nth-child(5) { width:12%; }
.devis-table th:nth-child(6), .devis-table td:nth-child(6) { width:38%; }
.devis-table td { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.devis-table td:nth-child(6) { white-space:normal; overflow:visible; text-overflow:initial; }

/* Tableau catalogue — colonnes rapprochées du produit */
.cat-body .b2b-table { table-layout:fixed; }
.cat-body .b2b-table th:nth-child(1), .cat-body .b2b-table td:nth-child(1) { width:32%; white-space:normal; }
.cat-body .b2b-table th:nth-child(2), .cat-body .b2b-table td:nth-child(2) { width:11%; text-align:right; }
.cat-body .b2b-table th:nth-child(3), .cat-body .b2b-table td:nth-child(3) { width:11%; text-align:right; }
.cat-body .b2b-table th:nth-child(4), .cat-body .b2b-table td:nth-child(4) { width:18%; text-align:right; }
.cat-body .b2b-table th:nth-child(5), .cat-body .b2b-table td:nth-child(5) { width:12%; text-align:center; }
.cat-body .b2b-table th:nth-child(6), .cat-body .b2b-table td:nth-child(6) { width:16%; text-align:center; }

/* Prix public Microsoft — cellule structurée */
.msrp-cell-inner { display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.msrp-price { font-size:12px; font-weight:700; color:#334155; text-decoration:none; display:inline-flex; align-items:center; gap:3px; }
.msrp-price:hover { color:#2563eb; text-decoration:underline; }
.msrp-price .bi { font-size:10px; color:#94a3b8; }
.msrp-price:hover .bi { color:#2563eb; }
.discount-badge { display:inline-block; background:#dcfce7; color:#059669; font-size:10px; font-weight:700; padding:2px 7px; border-radius:4px; letter-spacing:0.3px; }
.msrp-na { color:#cbd5e1; font-size:12px; }

/* Badge statuses */
.badge-draft { background:#f1f5f9; color:#64748b; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:600; }
.badge-sent { background:#eff6ff; color:#2563eb; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:600; }
.badge-pending { background:#fef3c7; color:#d97706; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:600; }
/* badge-validated removed — only Pending and Invoiced are used */
.badge-invoiced { background:#f3e8ff; color:#7c3aed; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:600; }
.sort-arrow { font-size:10px; color:#94a3b8; margin-left:2px; }
.filter-row th { padding:4px 8px !important; background:#f8fafc; }
.filter-input { width:100%; padding:5px 8px; border:1px solid #e2e8f0; border-radius:6px; font-size:12px; color:#334155; background:white; }
.filter-input:focus { outline:none; border-color:#3b82f6; box-shadow:0 0 0 2px rgba(59,130,246,0.15); }
.badge-paid { background:#dcfce7; color:#059669; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:600; display:inline-flex; align-items:center; gap:5px; }
.badge-paid::before { content:''; width:6px; height:6px; border-radius:50%; background:#059669; }
.badge-unpaid { background:#fef3c7; color:#d97706; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:600; display:inline-flex; align-items:center; gap:5px; }
.badge-unpaid::before { content:''; width:6px; height:6px; border-radius:50%; background:#f59e0b; }
.badge-overdue { background:#fef2f2; color:#dc2626; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:700; display:inline-flex; align-items:center; gap:5px; }
.badge-overdue::before { content:''; width:6px; height:6px; border-radius:50%; background:#dc2626; animation:pulse 1.5s infinite; }

/* Buttons */
.btn-primary-sm { padding:8px 18px; border-radius:8px; background:var(--pl-primary); color:#fff; border:none; font-size:13px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.btn-primary-sm:hover { background:#1d4ed8; }
.btn-outline-sm { padding:8px 18px; border-radius:8px; background:#fff; color:#64748b; border:1.5px solid var(--pl-border); font-size:13px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.btn-outline-sm:hover { border-color:var(--pl-primary); color:var(--pl-primary); }
.btn-warning-sm { padding:8px 18px; border-radius:8px; background:#f59e0b; color:#fff; border:none; font-size:13px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.btn-warning-sm:hover { background:#d97706; }
.btn-success-sm { padding:8px 18px; border-radius:8px; background:#059669; color:#fff; border:none; font-size:13px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.btn-success-sm:hover { background:#047857; }

/* Form inputs */
.fm-input, .fm-select { width:100%; padding:9px 14px; border:1.5px solid var(--pl-border); border-radius:8px; font-size:13px; background:#fff; transition:border-color 0.15s; }
.fm-input:focus, .fm-select:focus { outline:none; border-color:var(--pl-primary); box-shadow:0 0 0 3px rgba(37,99,235,0.1); }
.fm-label { font-size:12px; font-weight:600; color:#64748b; display:block; margin-bottom:4px; }
.fm-row { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:16px; }
.fm-row .field { flex:1; min-width:180px; }

/* Catalog */
.cat-section { margin-bottom:16px; }
.cat-header { display:flex; align-items:center; gap:10px; padding:10px 14px; background:#f8fafc; border:1px solid var(--pl-border); border-radius:8px 8px 0 0; cursor:pointer; font-weight:700; font-size:13px; color:#1e293b; }
.cat-header i.cat-icon { font-size:16px; }
.cat-header .cat-count { margin-left:auto; font-size:11px; font-weight:600; color:#64748b; background:#e2e8f0; padding:2px 8px; border-radius:10px; }
.cat-header .cat-chevron { transition:transform 0.2s; color:#94a3b8; }
.cat-header.collapsed .cat-chevron { transform:rotate(-90deg); }
.cat-body { border:1px solid var(--pl-border); border-top:none; border-radius:0 0 8px 8px; overflow:hidden; }

/* Price columns */
.price-tag { font-weight:700; font-size:13px; }
.price-retail { color:#2563eb; font-weight:700; font-size:13px; }
.price-volume { color:#7c3aed; font-weight:700; font-size:13px; }
.price-na { color:#cbd5e1; font-size:11px; font-style:italic; }
.btn-add { padding:6px 14px; border-radius:6px; background:#f0fdf4; color:#059669; border:1.5px solid #bbf7d0; font-size:11px; font-weight:700; cursor:pointer; white-space:nowrap; transition:all 0.15s; }
.btn-add:hover { background:#059669; color:#fff; border-color:#059669; }
.pdf-cert-badge { display:inline-block; padding:2px 8px; border-radius:4px; background:#fef3c7; color:#92400e; font-size:10px; font-weight:700; letter-spacing:0.3px; }
.qty-input { width:70px; padding:5px 8px; border:1.5px solid #e2e8f0; border-radius:6px; font-size:13px; text-align:center; font-weight:600; }
.qty-input:focus { outline:none; border-color:var(--pl-primary); }
.min-qty { font-size:10px; color:#94a3b8; display:block; }

/* Quote summary sidebar */
.quote-summary { position:sticky; top:20px; }
.summary-line { display:flex; justify-content:space-between; padding:6px 0; font-size:13px; border-bottom:1px solid #f1f5f9; }
.summary-total { display:flex; justify-content:space-between; padding:10px 0; font-size:15px; font-weight:800; color:var(--pl-primary); border-top:2px solid var(--pl-primary); margin-top:8px; }

/* Modal */
.modal-bg { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:2000; align-items:center; justify-content:center; }
.modal-bg.show { display:flex; }
.modal-box { background:#fff; border-radius:12px; max-width:500px; width:100%; box-shadow:0 20px 60px rgba(0,0,0,0.15); overflow:hidden; }
.modal-box-header { padding:16px 20px; border-bottom:1px solid var(--pl-border); font-weight:700; font-size:15px; display:flex; align-items:center; justify-content:space-between; }
.modal-box-body { padding:20px; }
.modal-box-footer { padding:12px 20px; border-top:1px solid var(--pl-border); display:flex; gap:8px; justify-content:flex-end; }

/* PDF Viewer Modal (wide) */
.pdf-modal-box { background:#fff; border-radius:12px; max-width:900px; width:95%; max-height:92vh; box-shadow:0 20px 60px rgba(0,0,0,0.2); display:flex; flex-direction:column; overflow:hidden; }
.pdf-modal-header { padding:14px 20px; border-bottom:1px solid var(--pl-border); display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; }
.pdf-modal-header h3 { font-size:15px; font-weight:700; margin:0; display:flex; align-items:center; gap:8px; }
.pdf-modal-body { flex:1; overflow:hidden; display:flex; flex-direction:column; }
.pdf-iframe { width:100%; flex:1; border:none; min-height:500px; }
.pdf-modal-footer { padding:12px 20px; border-top:1px solid var(--pl-border); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.pdf-info { display:flex; align-items:center; gap:12px; font-size:12px; color:#64748b; }
.pdf-info .pdf-badge { background:#dcfce7; color:#059669; padding:3px 10px; border-radius:6px; font-weight:600; font-size:11px; }

/* API Loading states */
.api-loading { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:60px 20px; color:#64748b; }
.api-loading .spinner { width:40px; height:40px; border:3px solid #e2e8f0; border-top-color:var(--pl-primary); border-radius:50%; animation:spin 0.8s linear infinite; margin-bottom:16px; }
@keyframes spin { to { transform:rotate(360deg); } }
.api-loading p { font-size:14px; font-weight:600; margin:0 0 4px; }
.api-loading small { font-size:12px; color:#94a3b8; }

.api-error { text-align:center; padding:40px 20px; }
.api-error i { font-size:40px; color:#dc2626; margin-bottom:12px; display:block; }
.api-error p { font-size:14px; font-weight:600; color:#1e293b; margin:0 0 4px; }
.api-error small { font-size:12px; color:#64748b; }

/* Info callout */
.info-callout { background:#eff6ff; border:1px solid #bfdbfe; border-radius:10px; padding:12px 16px; font-size:13px; color:#1e40af; display:flex; gap:8px; align-items:flex-start; margin-bottom:16px; }
.info-callout i { flex-shrink:0; margin-top:2px; }

/* WhatsApp contact strip */
.wa-contact-strip { display:flex; align-items:center; gap:14px; padding:14px 18px; background:linear-gradient(135deg,#25D366 0%,#128C7E 100%); color:#fff !important; border-radius:12px; text-decoration:none !important; margin-bottom:18px; box-shadow:0 2px 10px rgba(37,211,102,0.28); transition:transform .15s ease, box-shadow .15s ease; }
.wa-contact-strip:hover { transform:translateY(-1px); box-shadow:0 6px 18px rgba(37,211,102,0.38); color:#fff !important; text-decoration:none !important; }
.wa-contact-strip:focus-visible { outline:3px solid #fff; outline-offset:2px; }
.wa-contact-strip .wa-icon { width:44px; height:44px; flex-shrink:0; border-radius:50%; background:rgba(255,255,255,0.18); display:flex; align-items:center; justify-content:center; font-size:24px; }
.wa-contact-strip .wa-text { flex:1; display:flex; flex-direction:column; line-height:1.35; min-width:0; }
.wa-contact-strip .wa-text strong { font-size:14px; font-weight:800; letter-spacing:0.1px; }
.wa-contact-strip .wa-sub { font-size:12px; opacity:0.95; margin-top:2px; }
.wa-contact-strip .wa-cta { flex-shrink:0; background:rgba(255,255,255,0.18); padding:9px 14px; border-radius:8px; font-size:12px; font-weight:700; white-space:nowrap; display:flex; align-items:center; gap:6px; letter-spacing:0.2px; }
@media (max-width:760px) {
  .wa-contact-strip { flex-wrap:wrap; padding:12px 14px; gap:10px; }
  .wa-contact-strip .wa-text { flex-basis:calc(100% - 56px); }
  .wa-contact-strip .wa-sub { display:none; }
  .wa-contact-strip .wa-cta { width:100%; justify-content:center; }
}

/* Layout for new quote */
.new-quote-layout { display:grid; grid-template-columns:1fr 320px; gap:20px; }
@media (max-width:1024px) { .new-quote-layout { grid-template-columns:1fr; } }
.summary-sticky { position:sticky; top:20px; }

@media (max-width: 768px) {
  .b2b-table { font-size: 12px; }
  .b2b-table th, .b2b-table td { padding: 8px 6px; }
  .b2b-table th[style*="min-width"] { min-width: 0 !important; }
  .fm-row .field { min-width: 140px; }
  .b2b-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .b2b-table th, .b2b-table td { padding: 6px 4px; font-size: 11px; }
  .fm-row { flex-direction: column; gap: 8px; }
  .fm-row .field { min-width: 0; width: 100%; }
  .info-callout { padding: 10px 12px; font-size: 12px; }
}

@media (max-width: 390px) {
  .b2b-table th, .b2b-table td { padding: 4px 3px; font-size: 10px; }
  .info-callout { padding: 8px 10px; font-size: 11px; }
}

/* Mobile: show "desktop only" message, hide page content */
.mobile-desktop-only-msg { display: none; }

@media (max-width: 768px) {
  .mobile-desktop-only-msg {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 60px 24px; min-height: 60vh;
  }
  .mobile-desktop-only-msg .desktop-only-icon {
    width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex; align-items: center; justify-content: center; font-size: 36px; color: #2563eb; margin-bottom: 20px;
    border: 2px solid #93c5fd;
  }
  .mobile-desktop-only-msg h2 { font-size: 20px; font-weight: 800; color: #1e293b; margin: 0 0 8px; }
  .mobile-desktop-only-msg p { font-size: 14px; color: #64748b; margin: 0 0 6px; max-width: 320px; }
  .mobile-desktop-only-msg .desktop-only-sub { font-size: 13px; color: #94a3b8; margin-bottom: 24px; }
  .mobile-desktop-only-msg .desktop-only-hint {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
    background: #f0f9ff; border: 1.5px solid #bae6fd; border-radius: 12px;
    font-size: 13px; color: #0369a1; font-weight: 600;
  }
  .mobile-desktop-only-msg .desktop-only-hint i { font-size: 18px; }

  /* Hide ALL real page content on mobile */
  .portal-content > *:not(.mobile-desktop-only-msg) { display: none !important; }
  /* Hide "New Quote" button on mobile (page is desktop-only) */
  .header-actions { display: none !important; }
}
