/* =========================================
   GLOBAL FRONTEND STYLES
========================================= */

.wcsw-frontend-wrap,
.wcsw-myaccount-wrap,
.wcsw-settlement-request-wrap,
.wcsw-settlement-history-wrap,
.wcsw-settlement-detail-wrap {
    font-size: 15px;
    line-height: 1.6;
    color: #222;
}

.wcsw-frontend-wrap *,
.wcsw-myaccount-wrap *,
.wcsw-settlement-request-wrap *,
.wcsw-settlement-history-wrap *,
.wcsw-settlement-detail-wrap * {
    box-sizing: border-box;
}

.wcsw-section-title {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 600;
    color: #111;
}

.wcsw-subtitle {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.wcsw-muted {
    color: #666;
    font-size: 14px;
}

/* =========================================
   COMMON CARDS / BOXES
========================================= */

.wcsw-card,
.wcsw-box,
.wcsw-info-box,
.wcsw-status-box,
.wcsw-address-box,
.wcsw-instructions-box {
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.wcsw-card--soft {
    background: #fafafa;
}

.wcsw-card--highlight {
    border-color: #2271b1;
    box-shadow: 0 2px 10px rgba(34, 113, 177, 0.08);
}

/* =========================================
   NOTICES / ALERTS
========================================= */

.wcsw-notice {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    font-size: 14px;
}

.wcsw-notice p {
    margin: 0;
}

.wcsw-notice--info {
    background: #eef6fc;
    border-color: #b6d4ef;
    color: #124e78;
}

.wcsw-notice--success {
    background: #edf7ed;
    border-color: #b7dfb9;
    color: #1e4620;
}

.wcsw-notice--warning {
    background: #fff8e5;
    border-color: #f1d58a;
    color: #7a5700;
}

.wcsw-notice--error {
    background: #fdeeee;
    border-color: #f1b6b6;
    color: #7d1f1f;
}

/* =========================================
   SUMMARY / ELIGIBILITY BLOCK
========================================= */

.wcsw-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.wcsw-summary-item {
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    padding: 18px;
}

.wcsw-summary-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.wcsw-summary-value {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.wcsw-summary-value small {
    font-size: 13px;
    font-weight: 400;
    color: #666;
}

/* =========================================
   STATUS BADGES
========================================= */

.wcsw-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wcsw-status-submitted {
    background: #eef6fc;
    color: #124e78;
}

.wcsw-status-awaiting_dispatch,
.wcsw-status-product_dispatched,
.wcsw-status-verification_under_process {
    background: #fff4e5;
    color: #8a5b00;
}

.wcsw-status-product_received,
.wcsw-status-approved {
    background: #edf7ed;
    color: #256029;
}

.wcsw-status-paid,
.wcsw-status-settled,
.wcsw-status-paid_settled {
    background: #e8f4ff;
    color: #0d5ea8;
}

.wcsw-status-rejected,
.wcsw-status-cancelled_by_customer {
    background: #fdeeee;
    color: #a12622;
}

/* =========================================
   FORMS
========================================= */

.wcsw-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 18px;
}

.wcsw-form-group {
    flex: 1 1 280px;
    min-width: 240px;
}

.wcsw-form-group--full {
    flex: 1 1 100%;
    min-width: 100%;
}

.wcsw-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #222;
    font-size: 14px;
}

.wcsw-required {
    color: #c62828;
    margin-left: 3px;
}

.wcsw-form-input,
.wcsw-form-select,
.wcsw-form-textarea {
    width: 100%;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    background: #fff;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.4;
    color: #222;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wcsw-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.wcsw-form-input:focus,
.wcsw-form-select:focus,
.wcsw-form-textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wcsw-field-help {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.wcsw-field-error {
    margin-top: 6px;
    font-size: 12px;
    color: #c62828;
}

/* =========================================
   CHECKBOX / CONSENT
========================================= */

.wcsw-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0;
}

.wcsw-checkbox-wrap input[type="checkbox"] {
    margin-top: 3px;
}

.wcsw-checkbox-label {
    font-size: 14px;
    color: #333;
}

/* =========================================
   BUTTONS
========================================= */

.wcsw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.wcsw-btn,
.wcsw-btn:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #2271b1;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wcsw-btn:hover,
.wcsw-btn:focus {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
    text-decoration: none;
}

.wcsw-btn--secondary,
.wcsw-btn--secondary:visited {
    background: #fff;
    color: #2271b1;
}

.wcsw-btn--secondary:hover,
.wcsw-btn--secondary:focus {
    background: #f4f8fb;
    color: #135e96;
}

.wcsw-btn--danger,
.wcsw-btn--danger:visited {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

.wcsw-btn--danger:hover,
.wcsw-btn--danger:focus {
    background: #9f1f1f;
    border-color: #9f1f1f;
    color: #fff;
}

.wcsw-btn[disabled],
.wcsw-btn.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================================
   ELIGIBLE ITEMS TABLE
========================================= */

.wcsw-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

table.wcsw-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e2e2;
}

table.wcsw-table th,
table.wcsw-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #ececec;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

table.wcsw-table th {
    background: #f8f8f8;
    font-weight: 600;
    color: #222;
}

table.wcsw-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================
   HISTORY / REQUEST LIST CARDS
========================================= */

.wcsw-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wcsw-history-card {
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    padding: 18px;
}

.wcsw-history-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
}

.wcsw-history-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #111;
}

.wcsw-history-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.wcsw-history-meta-item {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 12px;
}

.wcsw-history-meta-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.wcsw-history-meta-value {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

/* =========================================
   TIMELINE / DETAIL
========================================= */

.wcsw-timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wcsw-timeline-item {
    position: relative;
    padding-left: 28px;
    padding-bottom: 18px;
}

.wcsw-timeline-item:last-child {
    padding-bottom: 0;
}

.wcsw-timeline-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2271b1;
}

.wcsw-timeline-item::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 20px;
    width: 2px;
    bottom: -4px;
    background: #dcdcdc;
}

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

.wcsw-timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}

.wcsw-timeline-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.wcsw-timeline-text {
    font-size: 14px;
    color: #333;
}

/* =========================================
   ADDRESS / INSTRUCTIONS BLOCKS
========================================= */

.wcsw-address-lines,
.wcsw-instruction-lines {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wcsw-address-lines li,
.wcsw-instruction-lines li {
    margin-bottom: 6px;
}

.wcsw-address-lines li:last-child,
.wcsw-instruction-lines li:last-child {
    margin-bottom: 0;
}

/* =========================================
   EMPTY STATE
========================================= */

.wcsw-empty-state {
    padding: 30px 20px;
    text-align: center;
    background: #fafafa;
    border: 1px dashed #d4d4d4;
    border-radius: 10px;
}

.wcsw-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
}

.wcsw-empty-state-text {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* =========================================
   LOADING / PROCESSING
========================================= */

.wcsw-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wcsw-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #d0d0d0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wcsw-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes wcsw-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1024px) {
    .wcsw-summary-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .wcsw-history-meta {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 767px) {
    .wcsw-summary-grid,
    .wcsw-history-meta {
        grid-template-columns: 1fr;
    }

    .wcsw-form-row {
        flex-direction: column;
        gap: 16px;
    }

    .wcsw-form-group,
    .wcsw-form-group--full {
        min-width: 100%;
    }

    .wcsw-history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wcsw-actions {
        flex-direction: column;
    }

    .wcsw-btn,
    .wcsw-btn:visited {
        width: 100%;
    }

    table.wcsw-table th,
    table.wcsw-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .wcsw-card,
    .wcsw-box,
    .wcsw-info-box,
    .wcsw-status-box,
    .wcsw-address-box,
    .wcsw-instructions-box,
    .wcsw-history-card {
        padding: 16px;
    }
}

/* =========================================
   DETAIL PAGE OVERFLOW FIXES
========================================= */

.wcsw-settlement-detail-wrap,
.wcsw-settlement-detail-wrap .wcsw-form-row,
.wcsw-settlement-detail-wrap .wcsw-form-group,
.wcsw-settlement-detail-wrap .wcsw-address-box,
.wcsw-settlement-detail-wrap .wcsw-status-box,
.wcsw-settlement-detail-wrap .wcsw-info-box,
.wcsw-settlement-detail-wrap .wcsw-card,
.wcsw-settlement-detail-wrap .wcsw-history-meta,
.wcsw-settlement-detail-wrap .wcsw-history-meta-item,
.wcsw-settlement-detail-wrap .wcsw-history-meta-value,
.wcsw-settlement-detail-wrap .wcsw-timeline,
.wcsw-settlement-detail-wrap .wcsw-timeline-item,
.wcsw-settlement-detail-wrap .wcsw-timeline-text {
    min-width: 0;
}

.wcsw-settlement-detail-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.wcsw-settlement-detail-wrap .wcsw-form-row {
    width: 100%;
    max-width: 100%;
}

.wcsw-settlement-detail-wrap .wcsw-form-group {
    min-width: 0 !important;
}

.wcsw-settlement-detail-wrap .wcsw-history-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wcsw-settlement-detail-wrap .wcsw-history-meta-item {
    min-width: 0;
    overflow: hidden;
}

.wcsw-settlement-detail-wrap .wcsw-history-meta-label {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.wcsw-settlement-detail-wrap .wcsw-history-meta-value {
    min-width: 0;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.wcsw-settlement-detail-wrap .wcsw-timeline-title,
.wcsw-settlement-detail-wrap .wcsw-timeline-date,
.wcsw-settlement-detail-wrap .wcsw-timeline-text {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.wcsw-settlement-detail-wrap .wcsw-address-lines li,
.wcsw-settlement-detail-wrap .wcsw-instruction-lines li {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.wcsw-settlement-detail-wrap .wcsw-summary-value {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.wcsw-settlement-detail-wrap .wcsw-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.wcsw-settlement-detail-wrap table.wcsw-table {
    width: 100%;
    min-width: 760px;
}

.wcsw-settlement-detail-wrap table.wcsw-table th,
.wcsw-settlement-detail-wrap table.wcsw-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    .wcsw-settlement-detail-wrap .wcsw-history-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .wcsw-settlement-detail-wrap .wcsw-form-row {
        display: flex !important;
        flex-direction: column;
        gap: 16px;
    }

    .wcsw-settlement-detail-wrap .wcsw-history-meta {
        grid-template-columns: 1fr;
    }
}

.wcsw-settlement-detail-wrap .wcsw-detail-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.wcsw-settlement-detail-wrap .wcsw-detail-col {
    min-width: 0;
}

@media (max-width: 900px) {
    .wcsw-settlement-detail-wrap .wcsw-detail-two-col {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   HARD FIX: DETAIL PAGE META GRID OVERFLOW
========================================= */

.wcsw-settlement-detail-wrap .wcsw-bank-meta-grid,
.wcsw-settlement-detail-wrap .wcsw-payout-meta-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.wcsw-settlement-detail-wrap .wcsw-bank-meta-grid > .wcsw-history-meta-item,
.wcsw-settlement-detail-wrap .wcsw-payout-meta-grid > .wcsw-history-meta-item {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.wcsw-settlement-detail-wrap .wcsw-bank-meta-grid .wcsw-history-meta-value,
.wcsw-settlement-detail-wrap .wcsw-payout-meta-grid .wcsw-history-meta-value,
.wcsw-settlement-detail-wrap .wcsw-bank-meta-grid .wcsw-history-meta-label,
.wcsw-settlement-detail-wrap .wcsw-payout-meta-grid .wcsw-history-meta-label {
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .wcsw-settlement-detail-wrap .wcsw-bank-meta-grid,
    .wcsw-settlement-detail-wrap .wcsw-payout-meta-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 767px) {
    .wcsw-settlement-detail-wrap .wcsw-history-meta {
        grid-template-columns: 1fr !important;
    }
}