.wrap,
.wrap * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.wrap {
    width: 100%;
    padding: 20px;
    margin: 20px auto;
    max-width: calc(100vw - 200px);
}

.folded .wrap {
    max-width: calc(100vw - 160px);
}

@media (max-width: 1200px) {
    .wrap {
        max-width: calc(100vw - 120px);
    }

    .folded .wrap {
        max-width: calc(100vw - 100px);
    }
}

@media (max-width: 960px) {
    .wrap {
        max-width: calc(100vw - 80px);
    }

    .folded .wrap {
        max-width: calc(100vw - 60px);
    }
}

@media (max-width: 768px) {
    .wrap {
        max-width: calc(100vw - 40px);
        margin: 15px auto;
        padding: 15px;
    }

    .folded .wrap {
        max-width: calc(100vw - 30px);
    }
}

@media (max-width: 600px) {
    .wrap {
        max-width: calc(100vw - 20px);
        margin: 10px auto;
        padding: 12px;
    }

    .folded .wrap {
        max-width: calc(100vw - 15px);
    }
}

@media (max-width: 480px) {
    .wrap {
        max-width: calc(100vw - 10px);
        margin: 5px auto;
        padding: 10px;
    }

    .folded .wrap {
        max-width: calc(100vw - 5px);
    }
}

.mfcrex-header-info {
    background: linear-gradient(135deg, #1e3c72, #667eea);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mfcrex-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 45px;
    margin-bottom: 15px;
    gap: 15px;
}

.mfcrex-header-left {
    flex: 0 0 auto;
    margin-right: auto;
}

.mfcrex-header-center {
    flex: 0 0 auto;
}

.mfcrex-header-logo {
    height: 32px;
    width: auto;
}

.mfcrex-header-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mfcrex-header-right {
    display: flex;
    gap: 8px;
}

.mfcrex-header-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mfcrex-header-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.mfcrex-header-action-btn.primary {
    background: #2563eb;
    border-color: #2563eb;
}

.mfcrex-header-action-btn.primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.mfcrex-header-info hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 15px 0;
}

.mfcrex-info-content {
    line-height: 1.6;
}

.mfcrex-info-content p {
    margin-bottom: 15px;
}

.mfcrex-info-content p:last-child {
    margin-bottom: 0;
}

.mfcrex-admin-content,
.mfcrex-empty-state-section,
.mfcrex-form-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.mfcrex-empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #64748b;
}

.mfcrex-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.mfcrex-empty-state h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #1e293b;
    font-weight: 600;
}

.mfcrex-empty-state p {
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.mfcrex-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.mfcrex-page-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mfcrex-page-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    border-color: #6366f1;
}

.mfcrex-page-header {
    background: #f8fafc;
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.mfcrex-crypto-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-right: 16px;
}

.mfcrex-page-info h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #1e293b;
    font-weight: 600;
}

.mfcrex-crypto-name {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.mfcrex-page-stats {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    background: #f8fafc;
}

.mfcrex-stat {
    text-align: center;
}

.mfcrex-stat-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mfcrex-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #6366f1;
}

.mfcrex-shortcode {
    padding: 16px 20px;
    background: #1e293b;
    color: white;
}

.mfcrex-shortcode label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mfcrex-shortcode input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.mfcrex-page-actions {
    padding: 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.mfcrex-btn {
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.mfcrex-btn-primary {
    background: #2563eb;
    color: white;
}

.mfcrex-btn-primary:hover {
    background: #1d4ed8;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.mfcrex-btn-secondary {
    background: #64748b;
    color: white;
}

.mfcrex-btn-secondary:hover {
    background: #475569;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.mfcrex-btn-danger {
    background: #dc2626;
    color: white;
}

.mfcrex-btn-danger:hover {
    background: #b91c1c;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.mfcrex-btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.mfcrex-form-section h2 {
    background: #f8fafc;
    margin: -20px -20px 20px -20px;
    padding: 15px 20px;
    font-size: 18px;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.mfcrex-section-desc {
    margin: 0 0 20px 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
}

.mfcrex-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.mfcrex-form-group {
    display: flex;
    flex-direction: column;
}

.mfcrex-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.mfcrex-form-group input,
.mfcrex-form-group select {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.mfcrex-form-group input:focus,
.mfcrex-form-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mfcrex-penalty-section {
    margin-top: 20px;
}

.mfcrex-penalty-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.mfcrex-radio-option {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.mfcrex-radio-option:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

.mfcrex-radio-option input[type="radio"] {
    display: none;
}

.mfcrex-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    margin-right: 16px;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mfcrex-radio-option input[type="radio"]:checked + .mfcrex-radio-custom {
    border-color: #6366f1;
    background: #6366f1;
}

.mfcrex-radio-option input[type="radio"]:checked + .mfcrex-radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mfcrex-radio-content strong {
    display: block;
    margin-bottom: 6px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
}

.mfcrex-radio-content p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.penalty-explanation {
    display: none;
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.penalty-explanation[data-type="reward_only"] {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.penalty-explanation[data-type="principal_only"] {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.penalty-explanation[data-type="total_amount"] {
    background: #dcfce7;
    border-left: 4px solid #10b981;
    color: #047857;
}

.mfcrex-periods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.mfcrex-period-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    text-align: center;
}

.mfcrex-period-card:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
}

.mfcrex-period-header {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 14px;
    font-weight: 700;
}

.mfcrex-period-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.mfcrex-period-card .mfcrex-form-group {
    padding: 16px;
    margin: 0;
}

.mfcrex-period-card .mfcrex-form-group label {
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 13px;
}

.mfcrex-period-card input {
    text-align: center;
    font-weight: 600;
    font-size: 15px;
}

.mfcrex-form-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 20px 0 0 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
}

.mfcrex-help-tooltip {
    width: 20px;
    height: 20px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.mfcrex-help-tooltip:hover {
    background: #4f46e5;
}

.mfcrex-help-content {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 200px;
    white-space: normal;
    max-width: 320px;
}

.mfcrex-help-content::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1e293b;
}

.mfcrex-help-tooltip:hover .mfcrex-help-content {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .mfcrex-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .mfcrex-header-left {
        margin-right: 0;
    }

    .mfcrex-header-title {
        font-size: 18px;
    }

    .mfcrex-pages-grid {
        grid-template-columns: 1fr;
    }

    .mfcrex-form-grid {
        grid-template-columns: 1fr;
    }

    .mfcrex-periods-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .mfcrex-page-actions {
        flex-direction: column;
    }

    .mfcrex-form-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .mfcrex-header-title {
        font-size: 16px;
    }

    .mfcrex-periods-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}
