/* SpotMart Buyer Tiers – Vendor Dashboard Styles */

.spotmart-tier-dashboard {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    margin-top: 0;
    width: 100%;
    max-width: none;
    float: none;
    flex: 1 1 100%;
    box-sizing: border-box;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.spotmart-tier-dashboard__header {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
    margin-bottom: 24px;
}

.spotmart-tier-dashboard__header.has-tabs {
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}

.spotmart-tier-title {
    font-size: 28px;
    margin: 0;
    color: #0f172a;
    font-weight: 700;
}

.spotmart-tier-invite-trigger {
    min-width: 120px;
    font-weight: 600;
    border-radius: 999px;
    padding: 10px 20px;
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 6px 12px rgba(34, 197, 94, 0.24);
    margin-left: auto;
}

.spotmart-tier-invite-trigger:hover,
.spotmart-tier-invite-trigger:focus {
    background: #16a34a;
    border-color: #16a34a;
}

.spotmart-tier-alert {
    display: none;
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 600;
}

.spotmart-tier-alert.is-visible {
    display: block;
}

.spotmart-tier-alert.is-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #34d399;
}

.spotmart-tier-alert.is-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #f87171;
}

.spotmart-tier-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    border-bottom: none;
    margin-bottom: 0;
    flex: 1 1 auto;
}

.spotmart-tier-tab {
    background: none;
    border: none;
    padding: 0 0 12px;
    position: relative;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s ease;
}

.spotmart-tier-tab__count {
    font-weight: 500;
    margin-left: 4px;
    color: inherit;
}

.spotmart-tier-tab.is-active {
    color: #16a34a;
    background: #f8fafc !important;
}

.spotmart-tier-tab:hover {
    background: #f8fafc !important;
    color: #16a34a ;
}

.spotmart-tier-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 3px;
    border-radius: 999px;
    background: #16a34a;
}

.spotmart-tier-panel {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    width: 100%;
}

.spotmart-tier-panel__header {
    padding: 20px 24px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.spotmart-tier-panel__title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.spotmart-tier-panel__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.spotmart-tier-search {
    position: relative;
    flex: 1 1 260px;
}

#spotmart-tier-search {
    width: 100%;
    height: 44px;
    padding: 10px 18px;
    border: 1px solid #b6b6b6;
    border-radius: 999px;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spotmart-tier-search input:focus {
    outline: none;
    border-color: #f8fafc;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
    background: #fff;
}

.spotmart-tier-sort {
    display: flex;
    align-items: center;
}

#spotmart-tier-sort-select {
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid #b6b6b6;
    background: #f8fafc;
    font-weight: 600;
    min-width: 160px;
}

.spotmart-tier-filter {
    position: relative;
}

.spotmart-tier-filter__toggle {
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid #b6b6b6;
    background: #f8fafc;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
}

.spotmart-tier-filter__toggle:hover,
.spotmart-tier-filter__toggle:focus {
    border-color: #f8fafc;
    color: #475569;
    background: #f8fafc;
    box-shadow: 0 0 0 3px #f8fafc;
    outline: none;
    border: 1px solid #b6b6b6;

}

.spotmart-tier-filter__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 22px 40px #f8fafc;
    min-width: 180px;
    padding: 10px 0;
    display: none;
    z-index: 20;
}

.spotmart-tier-filter__menu.is-open {
    display: block;
}

.spotmart-tier-filter__option {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 10px 18px;
    font-size: 14px;
    color: #475569;
}

.spotmart-tier-filter__option:hover,
.spotmart-tier-filter__option.is-active {
    background: #f1f5f9;
    color: #111827;
    font-weight: 600;
}

.spotmart-tier-panel__body {
    padding: 0 24px 24px;
}

.spotmart-tier-description {
    margin: 0 0 18px;
    color: #475569;
    font-size: 15px;
}

.spotmart-tier-table {
    width: calc(100% + 48px);
    margin: 0 -24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.spotmart-tier-table table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.spotmart-tier-table thead {
    background: #f8fafc;
}

.spotmart-tier-table th,
.spotmart-tier-table td {
    padding: 14px 18px;
    text-align: left;
    font-size: 14px;
    color: #0f172a;
}

.spotmart-tier-table th {
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

.spotmart-tier-table tbody tr:nth-child(even) {
    background: #fbfcff;
}

.spotmart-tier-table tbody tr:hover {
    background: #eef2ff;
}

.spotmart-tier-empty td {
    text-align: center;
    padding: 28px 18px;
    color: #64748b;
}

.spotmart-tier-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.spotmart-tier-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.spotmart-tier-status.is-accepted {
    background: #ecfdf5;
    color: #047857;
}

.spotmart-tier-status.is-pending {
    background: #fff7ed;
    color: #d97706;
}

.spotmart-tier-status.is-rejected {
    background: #fef2f2;
    color: #b91c1c;
}

.spotmart-tier-status.is-cancelled,
.spotmart-tier-status.is-expired {
    background: #f8fafc;
    color: #475569;
}

.spotmart-tier-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spotmart-tier-actions__select {
    min-width: 150px;
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid #cbd5f5;
    background: #fff;
}

.spotmart-tier-update {
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
}

.spotmart-tier-update:disabled {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.spotmart-tier-links {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.spotmart-tier-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
}

.spotmart-tier-link:hover,
.spotmart-tier-link:focus {
    text-decoration: underline;
    color: #2563eb;
    background: none;


}

/* Modal */
.spotmart-tier-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spotmart-tier-modal.is-open {
    display: flex;
}

.spotmart-tier-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.spotmart-tier-modal__dialog {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    padding: 28px;
    width: min(480px, 92vw);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
    z-index: 1;
}

.spotmart-tier-modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    color: #475569;
    cursor: pointer;
}

.spotmart-tier-modal__intro {
    margin-top: 8px;
    margin-bottom: 18px;
    color: #475569;
}

#spotmart-tier-invite-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#spotmart-tier-invite-form input,
#spotmart-tier-invite-form select {
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    padding: 10px 14px;
    font-size: 15px;
}

.spotmart-tier-modal__note {
    margin: 6px 0 0;
    font-size: 13px;
    color: #64748b;
}

.spotmart-tier-modal__optional {
    font-weight: 400;
    font-size: 0.9em;
    color: #64748b;
    margin-left: 4px;
}

.spotmart-tier-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.spotmart-tier-modal__message {
    display: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 4px;
}

.spotmart-tier-modal__message.is-visible {
    display: block;
}

.spotmart-tier-modal__message.is-success {
    background: #ecfdf5;
    color: #047857;
}

.spotmart-tier-modal__message.is-error {
    background: #fef2f2;
    color: #b91c1c;
}

/* Field-level error messages */
.spotmart-tier-field-error {
    margin-top: 6px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.spotmart-tier-field-error::before {
    content: "\26A0";
    margin-right: 6px;
    font-size: 14px;
}

/* Input error state */
#spotmart-tier-invite-form input.has-error,
#spotmart-tier-invite-form select.has-error {
    border-color: #f87171;
    background-color: #fef2f2;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

#spotmart-tier-invite-form input.has-error:focus,
#spotmart-tier-invite-form select.has-error:focus {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
    outline: none;
}

/* Responsive */
@media (max-width: 960px) {
    .spotmart-tier-panel__header {
        flex-direction: column;
        align-items: stretch;
    }

    .spotmart-tier-panel__controls {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .spotmart-tier-dashboard {
        padding: 20px;
    }
}

@media (max-width: 680px) {
    .spotmart-tier-tabs {
        flex-wrap: wrap;
        gap: 12px;
    }

    .spotmart-tier-dashboard__header {
        align-items: stretch;
    }

    .spotmart-tier-invite-trigger {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }

    .spotmart-tier-panel__body {
        padding: 0 16px 20px;
    }

    .spotmart-tier-table {
        width: 100%;
        margin: 0;
        border-radius: 12px;
    }

    .spotmart-tier-actions {
        flex-wrap: wrap;
    }
}
