/**
 * Subscription Dashboard Styles
 */
.we-subscription-dashboard {
    font-family: inherit;
    color: #111827;
}

.we-subscription-dashboard .wesub-page-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px 0;
    color: #111827;
}

/* Filters */
.we-subscription-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.wesub-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.wesub-search-wrapper .wesub-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
}

.wesub-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background-color: #fff !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wesub-search-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.wesub-filter-selects {
    display: flex;
    gap: 12px;
}

.wesub-select {
    padding: 10px 36px 10px 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 14px;
    background-color: #fff !important;
    color: #374151;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 8px center !important;
    background-repeat: no-repeat !important;
    background-size: 20px 20px !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    outline: none;
    cursor: pointer;
}

/* Stats Cards */
.we-subscription-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.wesub-stat-card {
    flex: 1;
    min-width: 250px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.wesub-stat-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wesub-stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.wesub-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.wesub-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wesub-stat-icon svg {
    width: 24px;
    height: 24px;
}

.wesub-icon-green {
    background-color: #ecfdf5;
    color: #10b981;
}

.wesub-icon-purple {
    background-color: #f3e8ff;
    color: #8b5cf6;
}

/* Table Wrapper for ListView */
.we-subscription-table-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
}

/* Subscription Details Cards (used in details page) */
.we-subscription-dashboard .we-subscription-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 32px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.we-subscription-dashboard .we-subscription-card h3 {
    margin: 0;
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f8fafc;
    text-transform: none;
    letter-spacing: normal;
}

/* Tables (both list and details) */
.we-subscription-dashboard table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 !important;
    border: none;
}

.we-subscription-dashboard th,
.we-subscription-dashboard td {
    padding: 16px 24px;
    text-align: left;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.we-subscription-dashboard tr:last-child th,
.we-subscription-dashboard tr:last-child td {
    border-bottom: none;
}

/* Specific Header styles */
.we-subscription-list th,
.we-subscription-details-items th,
.we-subscription-details-related th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #111827;
}

.we-subscription-details-summary th {
    font-weight: 500;
    color: #6b7280;
    width: 30%;
    background-color: #fff;
}

.we-subscription-dashboard tr:hover td {
    background-color: #f8fafc;
}

.we-subscription-card tr:hover td {
    background-color: inherit;
}

/* Links and Buttons */
.wesub-manage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    background-color: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.wesub-manage-btn:hover {
    background-color: #e5e7eb;
    color: #111827;
    text-decoration: none !important;
}

.wesub-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.wesub-back-link svg {
    width: 16px;
    height: 16px;
}

.wesub-back-link:hover {
    color: #111827;
}

/* Details View specific Layouts */
.wesub-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 16px;
}

.wesub-details-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wesub-details-title-wrap .wesub-page-title {
    margin: 0;
}

.wesub-details-actions {
    display: flex;
    gap: 12px;
}

.we-subscription-dashboard .button.btn {
    padding: 10px 20px;
    text-decoration: none !important;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.we-subscription-dashboard .wesub-btn-danger {
    background-color: #e11d48 !important; /* Rose 600 */
    color: #fff !important;
}

.we-subscription-dashboard .wesub-btn-danger:hover {
    background-color: #be123c !important; /* Rose 700 */
}

.we-subscription-dashboard .wesub-btn-primary {
    background-color: #1e40af !important; /* Blue 800 */
    color: #fff !important;
}

.we-subscription-dashboard .wesub-btn-primary:hover {
    background-color: #1e3a8a !important; /* Blue 900 */
}

/* 4 Column Stats Grid */
.wesub-stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.wesub-stat-card-small {
    padding: 16px 20px !important;
    border-radius: 10px !important;
    min-width: 0 !important; /* Override large min-width from the default card */
}

.wesub-text-lg {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

.wesub-card-header {
    margin: 0;
    padding: 16px 24px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #4b5563 !important;
    border-bottom: 1px solid #e5e7eb;
    background-color: #fff !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.wesub-totals-row td {
    padding-top: 16px !important;
    padding-bottom: 16px !important;
}

/* Status Badges */
.wesub-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    line-height: normal;
}

.wesub-status-badge.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.wesub-status-badge.status-completed {
    background-color: #dcfce7;
    color: #166534;
}

.wesub-status-badge.status-processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.wesub-status-badge.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.wesub-status-badge.status-on-hold {
    background-color: #fef3c7;
    color: #92400e;
}

.wesub-status-badge.status-cancelled {
    background-color: #f3f4f6;
    color: #374151;
}

/* Checkout Renewal Detail Box */
.wesub-checkout-renewal-notice {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 8px 0;
    overflow: hidden;
}

.wesub-crn-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 14px;
}

.wesub-crn-icon {
    color: #3b82f6;
}

.wesub-crn-body {
    padding: 16px;
}

.wesub-crn-title {
    margin: 0 0 16px 0;
    color: #475569;
    font-size: 13px;
}

.wesub-crn-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wesub-crn-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #64748b;
}

.wesub-crn-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 4px 0;
}

.wesub-crn-highlight {
    color: #0f172a;
}

.wesub-crn-total {
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
    margin-top: 4px;
}

.wesub-font-medium {
    font-weight: 500;
}

.wesub-status-badge.status-expired {
    background-color: #f3f4f6;
    color: #374151;
}

.wesub-status-badge.status-pending {
    background-color: #ffedd5;
    color: #9a3412;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .we-subscription-table-wrapper,
    .we-subscription-card {
        overflow-x: auto;
    }
}

/* Cancel Modal */
.wesub-front-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}
.wesub-front-modal .wesub-cancel-popup {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: wesubPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes wesubPopIn {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.wesub-front-modal .wesub-close-cancel {
    position: absolute;
    top: 16px; right: 16px;
    font-size: 24px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s;
}
.wesub-front-modal .wesub-close-cancel:hover { color: #111827; }
.wesub-front-modal .wesub-cancel-icon {
    background: #fee2e2;
    color: #ef4444;
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.wesub-front-modal h3 {
    margin: 0 0 12px;
    font-size: 20px;
    color: #111827;
    font-weight: 700;
}
.wesub-front-modal p {
    color: #6b7280;
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.6;
}
.wesub-front-modal .wesub-cancel-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.wesub-front-modal .wesub-btn-secondary {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: none;
}
.wesub-front-modal .wesub-btn-secondary:hover { background: #e5e7eb !important; }

/* Product Thumbnails */
.wesub-product-thumb img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}