/* Shared distributor UI primitives.
   Add these classes alongside page-specific classes to keep button and badge
   sizing consistent across all distributor screens. */

.du-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 30px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #dbe4f0;
    background: #fff;
    color: #0f172a;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.du-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.1);
    text-decoration: none;
}

.du-btn--primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
}

.du-btn--primary:hover {
    color: #fff;
}

.du-btn--success {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(180deg, #18a96a 0%, #0f9f63 100%);
    box-shadow: 0 14px 24px rgba(16, 185, 129, 0.2);
}

.du-btn--wide {
    min-height: 35px;
    padding-inline: 16px;
    border-radius: 13px;
}

.du-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 26px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.du-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    flex: 0 0 6px;
}

.du-badge--success {
    color: #15803d;
    background: #dcfce7;
}

.du-badge--live {
    color: #166534;
    background: #d1fae5;
}

.du-badge--pending {
    color: #a16207;
    background: #fde68a;
}

.du-badge--info {
    color: #1d4ed8;
    background: #dbeafe;
}

.du-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.du-pill--muted {
    color: #64748b;
    background: #eef2f7;
}

.du-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 11px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.du-tab:hover {
    color: #4c1d95;
    text-decoration: none;
}

.du-tab.is-active,
.du-tab--active {
    color: #6d28d9;
    background: #ede9fe;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.08);
}

.du-table-scroll,
.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

.du-table-scroll > table,
.du-table-scroll > .table,
.table-responsive > table,
.table-responsive > .table {
    width: max-content;
    min-width: 100%;
}

.du-table-scroll > table th,
.du-table-scroll > table td,
.du-table-scroll > .table th,
.du-table-scroll > .table td,
.table-responsive > table th,
.table-responsive > table td,
.table-responsive > .table th,
.table-responsive > .table td {
    white-space: nowrap;
}

@media (max-width: 767px) {
    .du-btn {
        min-height: 32px;
        padding: 7px 10px;
        font-size: 10px;
    }

    .du-btn--wide {
        min-height: 32px;
        padding-inline: 14px;
    }

    .du-badge,
    .du-pill {
        min-height: 22px;
        padding: 5px 8px;
        font-size: 9px;
    }

    .du-tab {
        min-height: 30px;
        padding: 0 10px;
        font-size: 10px;
    }
}

.du-tooltip {
    position: fixed;
    z-index: 2000;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 6px 10px;
    border-radius: 8px;
    background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.1px;
    box-shadow: 0 8px 20px rgba(76, 29, 149, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.du-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #6d28d9;
}

.du-tooltip.is-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #6d28d9;
}

.du-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ---- SweetAlert2 themed to the distributor UI ---- */
.swal2-popup {
    width: 22em !important;
    max-width: 92vw !important;
    padding: 1em 1.1em !important;
    border: 1px solid #eee8f5 !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: #0f172a !important;
    box-shadow: 0 20px 50px rgba(44, 16, 78, 0.16) !important;
}

.swal2-title {
    padding: 0 0 4px !important;
    color: #171321 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
    color: #64748b !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
}

.swal2-icon {
    margin: 1.25em auto 0.6em !important;
}

.swal2-icon.swal2-question {
    border-color: #ddd6fe !important;
    color: #7c2ce2 !important;
}

.swal2-icon.swal2-success {
    border-color: #bbf7d0 !important;
    color: #16a34a !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: #22c55e !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #16a34a !important;
}

.swal2-icon.swal2-warning {
    border-color: #fde68a !important;
    color: #d97706 !important;
}

.swal2-icon.swal2-error {
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #dc2626 !important;
}

.swal2-styled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px !important;
    min-height: 30px;
    min-width: 35px;
    padding: 0 16px !important;
    border-radius: 5px !important;
    font-size: small !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0.2px;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, background 160ms ease, border-color 160ms ease;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm,
.swal2-styled.swal2-confirm,
.swal2-popup .swal2-actions .swal2-confirm,
.swal2-container .swal2-confirm,
.ac-swal-success-ok {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-block;
    color: #fff !important;
    min-width: 35px;
    height: 30px !important;
    border-radius: 5px !important;
    font-size: small !important;
    border: none !important;
    outline: none !important;
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%) !important;
    background-color: #7c3aed !important;
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.28) !important;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:hover,
.swal2-styled.swal2-confirm:hover,
.swal2-popup .swal2-actions .swal2-confirm:hover,
.swal2-container .swal2-confirm:hover,
.ac-swal-success-ok:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    background: linear-gradient(90deg, #7c3aed 0%, #6d28d9 100%) !important;
    background-color: #6d28d9 !important;
    box-shadow: 0 14px 26px rgba(124, 58, 237, 0.34) !important;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus,
.swal2-styled.swal2-confirm:focus,
.swal2-popup .swal2-actions .swal2-confirm:focus,
.swal2-container .swal2-confirm:focus,
.ac-swal-success-ok:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18) !important;
}

.swal2-styled.swal2-confirm--danger {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.24) !important;
}

.swal2-styled.swal2-confirm--danger:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%) !important;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3) !important;
}

.swal2-styled.swal2-cancel,
.swal2-container .swal2-cancel {
    background: #fff !important;
    border: 1px solid #d9dce3 !important;
    color: #374151 !important;
    box-shadow: none !important;
}

.swal2-styled.swal2-cancel:hover,
.swal2-container .swal2-cancel:hover {
    background: #f7f7f9 !important;
    border-color: #cbd5e1 !important;
    color: #7c2ce2 !important;
    transform: translateY(-1px);
}

.swal2-actions {
    gap: 10px !important;
    margin-top: 16px !important;
    margin-bottom: 2px !important;
}

.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #7c3aed, #a78bfa) !important;
}

/* ---- Distributor notification bell ---- */
.distributor-notifications-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #e8dcfb;
    border-radius: 12px;
    background: #fff;
    color: #6d28d9;
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.08);
    transition: background 160ms ease, transform 160ms ease;
}

.distributor-notifications-toggle:hover {
    background: #f6f1fc;
}

.distributor-notifications-toggle[aria-expanded="true"] {
    background: #efe3ff;
}

.distributor-notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.distributor-notifications-menu {
    width: 340px;
    max-width: calc(100vw - 24px);
    padding: 0;
    border-color: #eee8f5;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(42, 18, 72, 0.16);
    position: absolute;
    right: 0px;
}

.distributor-notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1ebf9;
}

.distributor-notifications-header strong {
    font-size: 0.9rem;
    color: #171321;
}

.distributor-notifications-read-all {
    border: 0;
    background: transparent;
    padding: 0;
    color: #6d28d9;
    font-size: 0.75rem;
    font-weight: 600;
}

.distributor-notifications-read-all:hover {
    text-decoration: underline;
}

.distributor-notifications-list {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.distributor-notifications-item {
    display: block;
    padding: 11px 14px;
    border-bottom: 1px solid #f6f1fc;
    text-decoration: none;
    color: inherit;
    transition: background 150ms ease;
}

.distributor-notifications-item:last-child {
    border-bottom: 0;
}

.distributor-notifications-item:hover {
    background: #faf7ff;
    text-decoration: none;
}

.distributor-notifications-item.is-unread {
    background: #f7f2ff;
}

.distributor-notifications-item.is-unread:hover {
    background: #f0e8ff;
}

.distributor-notifications-item__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #171321;
}

.distributor-notifications-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.distributor-notifications-view {
    flex: 0 0 auto;
    color: #6d28d9;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.distributor-notifications-item__dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #7c2ce2;
    vertical-align: middle;
}

.distributor-notifications-item__message {
    margin-top: 2px;
    font-size: 0.75rem;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.distributor-notifications-item__time {
    display: block;
    margin-top: 5px;
    font-size: 0.68rem;
    color: #9aa3b2;
}

.distributor-notifications-empty {
    padding: 26px 14px;
    text-align: center;
    color: #9aa3b2;
    font-size: 0.8rem;
}

.distributor-notifications-footer {
    display: block;
    padding: 10px 14px;
    border-top: 1px solid #f1ebf9;
    text-align: center;
    color: #6d28d9;
    font-size: 0.78rem;
    font-weight: 600;
}

.distributor-notifications-footer:hover {
    background: #faf7ff;
}

@media (max-width: 767px) {
    .distributor-notifications-toggle {
        width: 36px;
        height: 36px;
    }

    .distributor-notifications-menu {
        width: 300px;
    }
}

/* Disabled Previous button on first step — red outline + icon */
.du-btn--prev-disabled,
.du-btn--prev-disabled:hover,
.du-btn--prev-disabled:active,
.du-btn--prev-disabled:focus {
    background: #fff;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: none;
}
