.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-header-left h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
}

.page-header-left p {
    font-size: 15px;
    color: var(--gray);
}

/* ===================================
   STATS GRID
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
    transform: translateY(-5px);
}

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

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.stat-card-icon.primary {
    background: var(--gradient);
}

.stat-card-icon.success {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
}

.stat-card-icon.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
}

.stat-card-icon.secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #38bdf8 100%);
}

.stat-card-icon svg {
    width: 26px;
    height: 26px;
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.stat-card-trend.up {
    color: var(--success);
}

.stat-card-trend.down {
    color: var(--danger);
}

.stat-card-trend svg {
    width: 14px;
    height: 14px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

/* ===================================
   PLANS SECTION
   =================================== */
.products-section {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--light);
}

.products-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.products-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.products-count {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
}

.products-search {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-light);
    pointer-events: none;
}

.search-input {
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    width: 280px;
    transition: all 0.3s ease;
    background: var(--white);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-input::placeholder {
    color: var(--gray-light);
}

/* ===================================
   PLANS TABLE
   =================================== */
.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table th,
.products-table td {
    padding: 16px 24px;
    text-align: left;
}

.products-table th {
    background: var(--light);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.products-table tbody tr {
    border-bottom: 1px solid var(--light);
    transition: all 0.2s ease;
}

.products-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.02);
}

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

/* Plan Info Cell */
.product-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.product-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-icon.starter {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.product-icon.pro {
    background: var(--gradient);
}

.product-icon.business {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.product-icon.enterprise {
    background: linear-gradient(135deg, var(--secondary) 0%, #0284c7 100%);
}

.product-details h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.product-details p {
    font-size: 13px;
    color: var(--gray);
}

/* Plan Price */
.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.product-price span {
    font-size: 13px;
    font-weight: 400;
    color: var(--gray);
}

/* Plan Billing Badge */
.product-billing,
.product-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.product-category {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.product-billing.monthly {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.product-billing.yearly {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.product-billing svg {
    width: 14px;
    height: 14px;
}

/* Plan Subscribers */
.product-subscribers {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-subscribers-avatars {
    display: flex;
}

.product-subscribers-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient);
    border: 2px solid var(--white);
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.product-subscribers-avatar:first-child {
    margin-left: 0;
}

.product-subscribers-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

/* Plan Status */
.product-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.product-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.product-status.inactive {
    background: var(--light);
    color: var(--gray);
}

.product-status.draft {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.product-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Plan Actions */
.product-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.product-action-btn:hover {
    background: var(--light);
    color: var(--dark);
}

.product-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.product-action-btn svg {
    width: 18px;
    height: 18px;
}

/* ===================================
   MODAL STYLES
   =================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--light);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 10;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light);
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary);
    color: var(--white);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--light);
    background: var(--light);
    position: sticky;
    bottom: 0;
}

/* ===================================
   FORM STYLES
   =================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-label .optional {
    font-weight: 400;
    color: var(--gray-light);
}

.form-label .required {
    color: var(--danger);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--gray-light);
}

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

.form-hint {
    font-size: 13px;
    color: var(--gray);
    margin-top: 6px;
}

/* Billing Toggle */
.billing-toggle {
    display: flex;
    background: var(--light);
    border-radius: 12px;
    padding: 4px;
}

.billing-option {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.billing-option.active {
    background: var(--white);
    color: var(--dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.billing-option svg {
    width: 18px;
    height: 18px;
}

.billing-discount {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Price Input */
.price-input-wrapper {
    position: relative;
}

.price-currency {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    font-weight: 600;
    color: var(--gray);
}

.price-input {
    padding-left: 44px;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--light);
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.toggle-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.toggle-info p {
    font-size: 13px;
    color: var(--gray);
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-light);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--gradient);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Conditional Field */
.conditional-field {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.conditional-field.active {
    max-height: 200px;
    opacity: 1;
    margin-top: 16px;
}

/* Features Section */
.features-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--light);
}

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

.features-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.add-feature-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-feature-btn:hover {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.add-feature-btn svg {
    width: 16px;
    height: 16px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--light);
    transition: all 0.3s ease;
}

.feature-item:hover {
    border-color: var(--primary-light);
}

.feature-item svg {
    width: 18px;
    height: 18px;
    color: var(--success);
    flex-shrink: 0;
}

.feature-item input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--dark);
}

.feature-item input:focus {
    outline: none;
}

.feature-item input::placeholder {
    color: var(--gray-light);
}

.feature-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--gray-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feature-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.feature-remove svg {
    width: 16px;
    height: 16px;
    color: inherit;
}

/* Preview Section */
.preview-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--light);
}

.preview-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 16px;
}

.product-preview-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid var(--light);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    transition: all 0.3s ease;
}

.product-preview-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
    transform: translateY(-4px);
}

.preview-product-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.preview-product-price {
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.preview-product-price span {
    font-size: 18px;
    font-weight: 400;
    background: none;
    -webkit-text-fill-color: var(--gray);
    color: var(--gray);
}

.preview-joining-fee {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 16px;
}

.preview-features {
    text-align: left;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--light);
}

.preview-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--dark);
    padding: 10px 0;
}

.preview-feature svg {
    width: 20px;
    height: 20px;
    color: var(--success);
    flex-shrink: 0;
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.products-section {
    animation: fadeIn 0.5s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.products-section { animation-delay: 0.25s; }

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .products-search {
        width: 100%;
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .products-table {
        display: block;
        overflow-x: auto;
    }

    .modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .billing-toggle {
        flex-direction: column;
    }
}

