/**
 * B2B Frontend Styles
 */

/* ---- Sidebar Info ---- */
.b2b-sidebar-info {
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f8f8;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
}

.b2b-sidebar-firma {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 3px;
}

.b2b-sidebar-email {
    color: #666;
    margin-bottom: 8px;
}

.b2b-sidebar-dugovanje,
.b2b-sidebar-dug-valute {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.b2b-label {
    font-weight: 600;
}

.b2b-red {
    color: #cc0000;
    font-weight: 700;
}

/* ---- Section Headers ---- */
.b2b-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.b2b-section-header h2 {
    margin: 0;
}

.b2b-section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Buttons ---- */
.b2b-btn-primary {
    background: #cc0000 !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 20px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: background 0.2s;
}

.b2b-btn-primary:hover {
    background: #a00 !important;
}

/* ---- Forms ---- */
.b2b-firma-form,
.b2b-settings-form {
    max-width: 600px;
}

.b2b-form-row {
    margin-bottom: 15px;
}

.b2b-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.b2b-form-row input[type="text"],
.b2b-form-row input[type="email"],
.b2b-form-row input[type="number"],
.b2b-form-row select,
.b2b-form-row textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.b2b-form-row textarea {
    resize: vertical;
}

.b2b-form-row--half {
    display: flex;
    gap: 15px;
}

.b2b-form-row--half > div {
    flex: 1;
}

.b2b-form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* ---- Tables ---- */
.b2b-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.b2b-table thead th {
    background: #cc0000;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.b2b-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.b2b-table tbody tr:hover {
    background: #fafafa;
}

.b2b-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

.b2b-orders-table-wrapper {
    overflow-x: auto;
}

/* Order rows */
.b2b-order-row {
    cursor: pointer;
}

.b2b-order-row:hover {
    background: #f5f5f5;
}

.b2b-expand-toggle {
    width: 30px;
    text-align: center;
}

.b2b-toggle-icon {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.b2b-expanded .b2b-toggle-icon {
    transform: rotate(180deg);
}

/* Order detail row */
.b2b-order-detail {
    background: #fafafa;
}

.b2b-order-detail td {
    padding: 0 12px 15px;
}

.b2b-order-items {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.b2b-order-items th {
    background: #f0f0f0;
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
}

.b2b-order-items td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.b2b-item-thumb img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.b2b-order-total {
    text-align: right;
    font-size: 15px;
    padding: 10px 0;
}

/* ---- Add to cart button in order items ---- */
.b2b-item-action-th {
    text-align: center;
    width: 60px;
}

.b2b-item-add-to-cart {
    text-align: center;
    width: 60px;
}

.b2b-add-single-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #cc0000;
    transition: all 0.2s ease;
    text-decoration: none;
}

.b2b-add-single-to-cart:hover {
    background: #cc0000;
    color: #fff;
}

.b2b-add-single-to-cart.b2b-adding {
    opacity: 0.5;
    pointer-events: none;
    animation: b2b-spin 0.8s linear infinite;
}

.b2b-add-single-to-cart.b2b-added {
    background: #28a745;
    color: #fff;
}

.b2b-out-of-stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    opacity: 0.4;
    cursor: not-allowed;
}

@keyframes b2b-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---- Delivery Estimate Banner ---- */
.b2b-delivery-estimate {
    font-size: 14px;
}

.b2b-delivery-info {
    flex: 1;
}

.b2b-delivery-date {
    font-size: 13px;
    margin-bottom: 4px;
}

.b2b-delivery-date strong {
    margin-right: 4px;
}

#b2b-delivery-date-value {
    font-weight: 700 !important;
    color: #cc0000 !important;
    font-size: 13px !important;
}

.b2b-delivery-countdown {
    font-size: 13px;
}

.b2b-countdown-label {
    margin-right: 4px;
}

.b2b-countdown-timer,
#b2b-countdown-timer {
    font-weight: 700 !important;
    color: #cc0000 !important;
    font-size: 13px !important;
    font-variant-numeric: tabular-nums;
}

.b2b-countdown-after {
    color: #666;
    font-style: italic;
}

.b2b-delivery-note {
    margin-top: 6px;
    font-size: 12px;
    color: #777;
}

@media (max-width: 480px) {
    .b2b-delivery-estimate {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

/* ---- Delivery Inline (header shortcode) ---- */
.b2b-delivery-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
}

.b2b-delivery-inline strong {
    color: #cc0000;
}

.b2b-delivery-inline-sep {
    color: #ccc;
    margin: 0 3px;
}

.b2b-delivery-inline-timer {
    font-weight: 700;
    color: #cc0000;
    font-variant-numeric: tabular-nums;
}

.b2b-delivery-inline-countdown-label {
    color: #777;
}

@media (max-width: 600px) {
    .b2b-delivery-inline {
        font-size: 11px;
        gap: 3px;
    }
}

/* Order status badges */
.b2b-order-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.b2b-order-status--processing,
.b2b-order-status--b2b-rezervacija {
    background: #fff3cd;
    color: #856404;
}

.b2b-order-status--completed,
.b2b-order-status--b2b-zakljucen {
    background: #d4edda;
    color: #155724;
}

.b2b-order-status--on-hold,
.b2b-order-status--pending {
    background: #e2e3e5;
    color: #383d41;
}

.b2b-order-status--b2b-kreirano {
    background: #cce5ff;
    color: #004085;
}

/* PDF/Reorder buttons */
.b2b-pdf-btn,
.b2b-reorder-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    padding: 4px;
    border-radius: 4px;
}

.b2b-pdf-btn:hover,
.b2b-reorder-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    background: #f5f5f5;
}

.b2b-pdf-btn svg,
.b2b-reorder-btn svg {
    display: block;
}

/* B2B / MP order type badge */
.b2b-order-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.b2b-order-type-badge--b2b {
    background: #cc0000;
    color: #fff;
}

.b2b-order-type-badge--retail {
    background: #e2e3e5;
    color: #383d41;
}

/* ---- Address Cards ---- */
.b2b-address-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    transition: box-shadow 0.2s;
}

.b2b-address-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.b2b-address-number {
    width: 36px;
    height: 36px;
    background: #cc0000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.b2b-address-details {
    flex: 1;
}

.b2b-address-details div {
    margin-bottom: 3px;
}

.b2b-address-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.b2b-address-form {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 15px;
}

/* ---- Claim statuses ---- */
.b2b-claim-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.b2b-claim-status--nova {
    background: #cce5ff;
    color: #004085;
}

.b2b-claim-status--u_obradi {
    background: #fff3cd;
    color: #856404;
}

.b2b-claim-status--resena {
    background: #d4edda;
    color: #155724;
}

.b2b-claim-status--odbijena {
    background: #f8d7da;
    color: #721c24;
}

.b2b-claim-form {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 20px;
}

.b2b-claim-response td {
    background: #f8f9fa;
    font-style: italic;
}

/* ---- Financial Card ---- */
.b2b-fin-update-date {
    color: #999;
    font-size: 12px;
}

.b2b-fin-summary-cards {
    display: flex;
    gap: 12px;
    margin: 15px 0 20px;
    flex-wrap: wrap;
}

.b2b-fin-card {
    flex: 1;
    min-width: 150px;
    background: #f8f8f8;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.b2b-fin-card--total {
    background: #fff3cd;
    border-color: #ffc107;
}

.b2b-fin-card-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.b2b-fin-card-value {
    font-size: 16px;
    font-weight: 700;
}

.b2b-fin-filter {
    margin-bottom: 15px;
}

.b2b-fin-filter label {
    font-weight: 600;
    margin-right: 8px;
}

.b2b-fin-filter select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ---- B2B Price Display ---- */
.b2b-price-wrapper {
    display: block !important;
    width: 100%;
}

.b2b-vp-price,
.b2b-mp-price {
    display: block !important;
}

/* VP cena label crvena */
.b2b-vp-price strong {
    color: #cc0000;
}

/* MP cena siva SAMO kad je VP ukljucena — kad je MP mod nema nikakvog custom stila */
body:not(.b2b-price-mode-mp) .b2b-mp-price,
body:not(.b2b-price-mode-mp) .b2b-mp-price del,
body:not(.b2b-price-mode-mp) .b2b-mp-price .woocommerce-Price-amount {
    color: #999;
}

.b2b-badge {
    display: inline-block;
    background: #cc0000;
    color: #fff;
    padding: 5px 15px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.b2b-login-for-price {
    font-style: italic;
    color: #666;
}

.b2b-contact-price,
.b2b-contact-price-loop {
    color: #cc0000;
    font-weight: 600;
}

/* Product link in order items */
.b2b-product-link {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.b2b-product-link:hover {
    color: #cc0000;
    text-decoration: underline;
}

/* Cancel order button */
.b2b-cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    padding: 4px;
    border-radius: 4px;
}

.b2b-cancel-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    background: #fee;
}

/* Credit limit warning */
.b2b-credit-limit-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
}

.b2b-credit-limit-block {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: #721c24;
}

/* Export buttons */
.b2b-export-btns {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.b2b-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #555;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.b2b-export-btn:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* ---- No Data ---- */
.b2b-no-data {
    color: #999;
    font-style: italic;
    padding: 20px 0;
}

/* ============================================
   WAITLIST
   ============================================ */

.b2b-subsection-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.b2b-info-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.b2b-waitlist-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.b2b-waitlist-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.b2b-waitlist-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.b2b-waitlist-card--available {
    border-left: 3px solid #059669;
}

.b2b-waitlist-thumb {
    flex-shrink: 0;
}

.b2b-waitlist-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.b2b-waitlist-info {
    flex: 1;
    min-width: 0;
}

.b2b-waitlist-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.b2b-waitlist-sku {
    color: #999;
    font-size: 11px;
}

.b2b-waitlist-meta {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.b2b-waitlist-status-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.b2b-stock-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.b2b-stock-badge--in {
    background: #d4edda;
    color: #155724;
}

.b2b-stock-badge--out {
    background: #f8d7da;
    color: #721c24;
}

.b2b-btn-small {
    padding: 4px 12px !important;
    font-size: 12px !important;
}

.b2b-waitlist-actions {
    flex-shrink: 0;
}

.b2b-waitlist-remove {
    background: none !important;
    border: 1px solid #ddd !important;
    border-radius: 50% !important;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    color: #999;
    transition: all 0.2s;
    padding: 0 !important;
}

.b2b-waitlist-remove:hover {
    background: #fee !important;
    color: #cc0000;
    border-color: #cc0000 !important;
}

/* Subscribe button on product page */
.b2b-waitlist-subscribe {
    background: #cc0000;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.b2b-waitlist-subscribe:hover {
    background: #a00;
}

.b2b-btn-subscribed {
    background: #059669 !important;
    cursor: default;
}

/* Waitlist box on single product page */
.b2b-waitlist-box {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 8px;
}

.b2b-waitlist-msg {
    font-size: 13px;
    margin: 0 0 10px;
    color: #666;
}

.b2b-waitlist-msg--active {
    color: #059669;
    font-weight: 600;
}

.b2b-waitlist-remove-single {
    font-size: 12px;
    color: #999 !important;
    border-color: #ddd !important;
}

.b2b-waitlist-remove-single:hover {
    color: #cc0000 !important;
    border-color: #cc0000 !important;
}

/* Waitlist in product loop */
.b2b-waitlist-subscribe--loop {
    width: 100%;
    margin-top: 8px;
    font-size: 12px !important;
    padding: 6px 12px !important;
}

.b2b-waitlist-loop-msg {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #059669;
    font-weight: 600;
    margin-top: 8px;
}

/* ============================================
   CLAIMS / REKLAMACIJE (EXPANDED)
   ============================================ */

.b2b-claims-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.b2b-claim-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.b2b-claim-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.b2b-claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    gap: 10px;
}

.b2b-claim-header:hover {
    background: #fafafa;
}

.b2b-claim-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.b2b-claim-id {
    font-weight: 700;
    font-size: 14px;
    color: #333;
}

.b2b-claim-date {
    font-size: 12px;
    color: #888;
}

.b2b-claim-order {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
}

.b2b-claim-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.b2b-claim-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.b2b-claim-card--expanded .b2b-claim-toggle .b2b-toggle-icon {
    transform: rotate(180deg);
    display: inline-block;
}

.b2b-claim-preview {
    padding: 0 15px 10px;
    font-size: 13px;
    color: #666;
}

.b2b-claim-detail {
    padding: 15px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* Timeline */
.b2b-claim-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #eee;
}

.b2b-timeline-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.b2b-timeline-item::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #ddd;
    margin: 0 8px;
}

.b2b-timeline-item:last-child::after {
    display: none;
}

.b2b-timeline-item--active::after {
    background: #059669;
}

.b2b-timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    flex-shrink: 0;
}

.b2b-timeline-item--active .b2b-timeline-dot {
    background: #059669;
}

.b2b-timeline-item--odbijena .b2b-timeline-dot {
    background: #dc2626;
}

.b2b-timeline-content {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
}

.b2b-timeline-content strong {
    font-size: 12px;
    color: #333;
}

.b2b-timeline-date {
    font-size: 10px;
    color: #888;
}

/* Claim full info blocks */
.b2b-claim-full-info {
    margin-bottom: 15px;
}

.b2b-claim-info-block {
    margin-bottom: 12px;
}

.b2b-claim-info-block label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}

.b2b-claim-info-block div {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

/* Claim files */
.b2b-claim-files {
    margin-bottom: 15px;
}

.b2b-claim-files label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
}

.b2b-claim-files-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.b2b-claim-file-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: transform 0.2s;
}

.b2b-claim-file-thumb img:hover {
    transform: scale(1.05);
}

.b2b-claim-file-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    color: #333;
}

.b2b-claim-file-link:hover {
    background: #e0e0e0;
}

/* Admin response block */
.b2b-claim-response-block {
    background: #e8f5e9;
    border-left: 3px solid #059669;
    padding: 12px 15px;
    border-radius: 0 6px 6px 0;
}

.b2b-claim-response-block label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #059669;
    margin-bottom: 4px;
}

.b2b-claim-response-text {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

.b2b-file-hint {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* ============================================
   ANALYTICS DASHBOARD
   ============================================ */

/* ---- KPI Grid ---- */
.b2b-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.b2b-kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: box-shadow 0.2s, transform 0.15s;
}

.b2b-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.b2b-kpi-card--primary {
    background: linear-gradient(135deg, #cc0000 0%, #a00 100%);
    border-color: transparent;
}

.b2b-kpi-card--primary .b2b-kpi-label,
.b2b-kpi-card--primary .b2b-kpi-value,
.b2b-kpi-card--primary .b2b-kpi-sub {
    color: #fff !important;
}

.b2b-kpi-card--primary .b2b-kpi-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.b2b-kpi-card--warning {
    border-left: 3px solid #f0ad4e;
}

.b2b-kpi-card--danger {
    border-left: 3px solid #d9534f;
    background: #fff5f5;
}

.b2b-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fef2f2;
    color: #cc0000;
}

.b2b-kpi-icon--blue {
    background: #eff6ff;
    color: #2563eb;
}

.b2b-kpi-icon--green {
    background: #ecfdf5;
    color: #059669;
}

.b2b-kpi-icon--purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.b2b-kpi-icon--orange {
    background: #fffbeb;
    color: #d97706;
}

.b2b-kpi-icon--red {
    background: #fef2f2;
    color: #dc2626;
}

.b2b-kpi-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.b2b-kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.b2b-kpi-value {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.b2b-kpi-sub {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.b2b-kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 700;
    font-size: 11px;
    margin-left: 4px;
}

.b2b-kpi-change--up {
    color: #059669;
}

.b2b-kpi-change--down {
    color: #dc2626;
}

.b2b-kpi-card--primary .b2b-kpi-change--up {
    color: #bbf7d0;
}

.b2b-kpi-card--primary .b2b-kpi-change--down {
    color: #fca5a5;
}

/* ---- Credit Limit Progress Bar ---- */
.b2b-credit-bar-wrap {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.b2b-credit-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.b2b-credit-bar {
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
}

.b2b-credit-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}

.b2b-bar--ok {
    background: linear-gradient(90deg, #059669, #34d399);
}

.b2b-bar--warning {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

.b2b-bar--danger {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

.b2b-credit-bar-pct {
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    margin-top: 4px;
}

/* ---- Charts Layout ---- */
.b2b-charts-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.b2b-chart-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.b2b-chart-card h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.b2b-chart-card--wide {
    flex: 2;
}

.b2b-chart-card--narrow {
    flex: 1;
    min-width: 260px;
}

.b2b-chart-card--full {
    width: 100%;
}

.b2b-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.b2b-chart-header h3 {
    margin: 0;
}

.b2b-chart-year-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

.b2b-chart-container {
    position: relative;
    height: 280px;
}

.b2b-chart-container--square {
    height: 260px;
}

.b2b-chart-container--tall {
    height: 350px;
}

.b2b-analytics-period-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .b2b-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .b2b-fin-summary-cards {
        flex-direction: column;
    }

    .b2b-form-row--half {
        flex-direction: column;
        gap: 10px;
    }

    .b2b-address-card {
        flex-direction: column;
    }

    .b2b-address-actions {
        width: 100%;
    }

    .b2b-table {
        font-size: 12px;
    }

    .b2b-table thead th,
    .b2b-table tbody td {
        padding: 8px 6px;
    }

    /* Waitlist responsive */
    .b2b-waitlist-card {
        flex-wrap: wrap;
    }

    .b2b-waitlist-status-col {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }

    /* Claims responsive */
    .b2b-claim-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .b2b-claim-header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .b2b-claim-timeline {
        flex-direction: column;
        gap: 10px;
    }

    .b2b-timeline-item::after {
        display: none;
    }

    /* Analytics responsive */
    .b2b-kpi-grid {
        grid-template-columns: 1fr;
    }

    .b2b-charts-row {
        flex-direction: column;
    }

    .b2b-chart-card--narrow {
        min-width: 100%;
    }

    .b2b-chart-container {
        height: 220px;
    }

    .b2b-chart-container--tall {
        height: 300px;
    }

    .b2b-kpi-value {
        font-size: 15px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .b2b-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- B2B Checkout: Hidden billing fields ---- */
.b2b-hidden-field { display: none !important; }

/* ---- B2B Checkout: Sections ---- */
.b2b-checkout-section { margin: 20px 0; }
.b2b-checkout-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }

/* ---- B2B Checkout: Radio option cards ---- */
.b2b-radio-options { display: flex; gap: 10px; flex-wrap: wrap; }
.b2b-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #f9f9f9;
    transition: border-color 0.2s, background 0.2s;
}
.b2b-radio-option:has(input:checked) {
    border-color: #cc0000;
    background: #fff;
}
.b2b-radio-option input[type="radio"] { margin: 0; }
.b2b-radio-option span { font-weight: 600; font-size: 14px; }
.b2b-option-logo { width: 24px; height: 24px; object-fit: contain; }

/* ---- B2B Checkout: Delivery selector ---- */
.b2b-delivery-selector { margin-bottom: 20px; }
.b2b-delivery-tabs { display: flex; gap: 10px; margin-bottom: 15px; }
.b2b-delivery-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #f9f9f9;
}
.b2b-delivery-tab:has(input:checked) { border-color: #cc0000; background: #fff; }
.b2b-delivery-tab input { margin: 0; }
.b2b-delivery-tab span { font-weight: 600; }
.b2b-store-option {
    display: block;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
}
.b2b-store-option:has(input:checked) { border-color: #cc0000; background: #fef7f7; }
.b2b-store-option input { margin-right: 8px; }
.b2b-store-address { display: block; margin-left: 24px; color: #666; font-size: 13px; }
